apply wayland coding style 50/60850/2
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 2 Mar 2016 12:39:00 +0000 (21:39 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 2 Mar 2016 12:43:54 +0000 (21:43 +0900)
Change-Id: Ibb94f2f2d454f977151cc935333298b3af434e9f

12 files changed:
include/eom-connect.h
include/eom.h
include/eom_internal.h
src/dbus/eom-connect.c
src/dbus/eom-dbus.c
src/dbus/eom-dbus.h [changed mode: 0755->0644]
src/eom-log.h
src/eom-private.h [changed mode: 0755->0644]
src/eom.c
src/wayland/eom-wayland.c
src/wayland/eom-wayland.h [changed mode: 0755->0644]
src/wayland/protocol/eom-client-protocol.h

index c5b18f4..c0f4c8e 100644 (file)
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_CONNECT_H__
@@ -54,7 +55,8 @@ extern "C" {
  * @brief Set mode to external output.
  * @param[in] output : The pointer of external output instance
  * @param[in] output_id : eom output id
- * @return #EOM_ERROR_NONE if this function succeeds, otherwise error status value
+ * @return #EOM_ERROR_NONE if this function succeeds.
+ *              otherwise error status value.
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #EOM_ERROR_SEND_MESSAGE_FAILE Message sending failure
index 98f467c..0a351f1 100644 (file)
@@ -1,35 +1,35 @@
 /**************************************************************************
-
-External Output Manager (EOM)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-JunKyeong Kim <jk0430.kim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_H__
@@ -55,7 +55,7 @@ extern "C" {
  * @file eom.h
  */
 #ifndef TIZEN_ERROR_EOM
-#define TIZEN_ERROR_EOM                        -0x02F20000 | 0x00
+#define TIZEN_ERROR_EOM                        (-0x02F20000 | 0x00)
 #endif
 /**
  * @brief Enumeration of External Output Manager (EOM) error type
@@ -138,40 +138,48 @@ typedef enum {
 typedef unsigned int eom_output_id;
 
 /**
- * @brief Called when External Output Manager (EOM) module sends output connection notification.
+ * @brief Called when External Output Manager (EOM) module sends output
+ *           connection notification.
  * @since_tizen 2.4
  * @param[in] output_id  The output id which is connected output
- * @param[in] user_data  The pointer of user data which is passed to eom_output_added_cb function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_output_added_cb function
  * @see eom_set_output_added_cb()
  * @see eom_unset_output_added_cb()
  */
 typedef void (*eom_output_added_cb)(eom_output_id output_id, void *user_data);
 
 /**
- * @brief Called when External Output Manager (EOM) module sends output disconnection notification.
+ * @brief Called when External Output Manager (EOM) module sends output
+ *           disconnection notification.
  * @since_tizen 2.4
  * @param[in] output_id  The output id which is connected output
- * @param[in] user_data  The pointer of user data which is passed to eom_output_removed_cb function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_output_removed_cb function
  * @see eom_set_output_removed_cb()
  * @see eom_unset_output_removed_cb()
  */
 typedef void (*eom_output_removed_cb)(eom_output_id output_id, void *user_data);
 
 /**
- * @brief Called when External Output Manager (EOM) module sends output mode changing notification.
+ * @brief Called when External Output Manager (EOM) module sends output
+ *           mode changing notification.
  * @since_tizen 2.4
  * @param[in] output_id  The output id which is connected output
- * @param[in] user_data  The pointer of user data which is passed to eom_mode_changed_cb function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_mode_changed_cb function
  * @see eom_set_mode_changed_cb()
  * @see eom_unset_mode_changed_cb()
  */
 typedef void (*eom_mode_changed_cb)(eom_output_id output_id, void *user_data);
 
 /**
- * @brief Called when External Output Manager (EOM) module sends output attribute changing notification.
+ * @brief Called when External Output Manager (EOM) module sends output
+ *           attribute changing notification.
  * @since_tizen 2.4
  * @param[in] output_id  The output id which is connected output
- * @param[in] user_data  The pointer of user data which is passed to eom_attribute_changed_cb function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_attribute_changed_cb function
  * @see eom_set_attribute_changed_cb()
  * @see eom_unset_attribute_changed_cb()
  */
@@ -192,17 +200,21 @@ int eom_init(void);
 
 /**
  * @brief Finalizes External Output Manager (EOM).
- * @details User should call this function after using EOM to release all resources of EOM.
+ * @details User should call this function after using EOM to release all
+ *              resources of EOM.
  * @since_tizen 2.4
  * @see eom_init()
  */
 void eom_deinit(void);
 
 /**
- * @brief Registers a callback function to get output connection notification from External Output Manager (EOM) module.
+ * @brief Registers a callback function to get output connection notification
+ *           from External Output Manager (EOM) module.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_output_added_cb callback function
- * @param[in] user_data  The pointer of user data which is passed to eom_output_added_cb function
+ * @param[in] callback  The function pointer of eom_output_added_cb callback
+ *                                function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_output_added_cb function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_OUT_OF_MEMORY Memory allocation failure
@@ -217,7 +229,8 @@ int eom_set_output_added_cb(eom_output_added_cb callback, void *user_data);
 /**
  * @brief Unregisters the callback function.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_output_added_cb callback function
+ * @param[in] callback  The function pointer of eom_output_added_cb callback
+ *                                function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
@@ -229,10 +242,13 @@ int eom_set_output_added_cb(eom_output_added_cb callback, void *user_data);
 int eom_unset_output_added_cb(eom_output_added_cb callback);
 
 /**
- * @brief Registers a callback function to get output disconnection notification from External Output Manager (EOM) module.
+ * @brief Registers a callback function to get output disconnection
+ *           notification from External Output Manager (EOM) module.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_output_removed_cb callback function
- * @param[in] user_data  The pointer of user data which is passed to eom_output_removed_cb function
+ * @param[in] callback  The function pointer of eom_output_removed_cb callback
+ *                                function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_output_removed_cb function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_OUT_OF_MEMORY Memory allocation failure
@@ -247,7 +263,8 @@ int eom_set_output_removed_cb(eom_output_removed_cb callback, void *user_data);
 /**
  * @brief Unregisters the callback function.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_output_removed_cb callback function
+ * @param[in] callback  The function pointer of eom_output_removed_cb callback
+ *                                function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
@@ -259,10 +276,13 @@ int eom_set_output_removed_cb(eom_output_removed_cb callback, void *user_data);
 int eom_unset_output_removed_cb(eom_output_removed_cb callback);
 
 /**
- * @brief Registers a callback function to get output mode changing notification from External Output Manager (EOM) module.
+ * @brief Registers a callback function to get output mode changing
+ *           notification from External Output Manager (EOM) module.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_mode_changed_cb callback function
- * @param[in] user_data  The pointer of user data which is passed to eom_mode_changed_cb function
+ * @param[in] callback  The function pointer of eom_mode_changed_cb callback
+ *                                function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_mode_changed_cb function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_OUT_OF_MEMORY Memory allocation failure
@@ -277,7 +297,8 @@ int eom_set_mode_changed_cb(eom_mode_changed_cb callback, void *user_data);
 /**
  * @brief Unregisters the callback function.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_mode_changed_cb callback function
+ * @param[in] callback  The function pointer of eom_mode_changed_cb callback
+ *                                function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
@@ -289,10 +310,13 @@ int eom_set_mode_changed_cb(eom_mode_changed_cb callback, void *user_data);
 int eom_unset_mode_changed_cb(eom_mode_changed_cb callback);
 
 /**
- * @brief Registers a callback function to get output attribute changing notification from External Output Manager (EOM) module.
+ * @brief Registers a callback function to get output attribute changing
+ *           notification from External Output Manager (EOM) module.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_attribute_changed_cb callback function
- * @param[in] user_data  The pointer of user data which is passed to eom_attribute_changed_cb function
+ * @param[in] callback  The function pointer of eom_attribute_changed_cb
+ *                                callback function
+ * @param[in] user_data  The pointer of user data which is passed to
+ *                                   eom_attribute_changed_cb function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_OUT_OF_MEMORY Memory allocation failure
@@ -307,7 +331,8 @@ int eom_set_attribute_changed_cb(eom_attribute_changed_cb callback, void *user_d
 /**
  * @brief Unregisters the callback function.
  * @since_tizen 2.4
- * @param[in] callback  The function pointer of eom_attribute_changed_cb callback function
+ * @param[in] callback  The function pointer of eom_attribute_changed_cb
+ *                                callback function
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
@@ -320,15 +345,17 @@ int eom_unset_attribute_changed_cb(eom_attribute_changed_cb callback);
 
 /**
  * @brief Gets the IDs and count of external output.
- * @details This function returns the IDs of external output which are available to connect
- * to target device, and the count of them also. User can get the id of external output
+ * @details This function returns the IDs of external output which are
+ *              available to connect to target device, and the count of them
+ *              also. User can get the id of external output.
  * which user want to watch.
  * @since_tizen 2.4
- * @remarks User should free return value by using free().\n
+ * @remarks User should free return value by using free().
  * The specific error code can be obtained using the get_last_result() method.
  * Error codes are described in Exception section.
  * @param[out] count  The count of the eom_output_id supported by system
- * @return The array of the eom_output_id if this function succeeds, otherwise NULL
+ * @return The array of the eom_output_id if this function succeeds, otherwise
+ *             NULL
  * @retval The pointer of #eom_output_id
  * @exception #EOM_ERROR_NONE Successful
  * @exception #EOM_ERROR_INVALID_PARAMETER Invalid parameter
@@ -450,7 +477,8 @@ int eom_get_output_physical_size(eom_output_id output_id, int *phy_width, int *p
 
 /**
  * @brief Sets the attribute of the external output ID.
- * @details The application can set the External Output Manager (EOM) attribute to the external output ID.
+ * @details The application can set the External Output Manager (EOM) attribute
+ *              to the external output ID.
  * The EOM module manages the windows to display on external output and
  * control the policy of external output. The application can recognize
  * the attribute state and manage the resources when the application receives
@@ -462,7 +490,8 @@ int eom_get_output_physical_size(eom_output_id output_id, int *phy_width, int *p
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #EOM_ERROR_NO_SUCH_DEVICE Invalid external output instance
- * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM module
+ * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM
+ *              module
  * @retval #EOM_ERROR_MESSAGE_OPERATION_FAILURE Operation failure
  * @pre eom_init()
  * @pre eom_get_eom_output_ids()
@@ -472,7 +501,8 @@ int eom_get_output_physical_size(eom_output_id output_id, int *phy_width, int *p
 int eom_set_output_attribute(eom_output_id output_id, eom_output_attribute_e attr);
 
 /**
- * @brief Sets window to the external output best resolution of external output device.
+ * @brief Sets window to the external output best resolution of external output
+ *           device.
  * @since_tizen 2.4
  * @param[in] output_id  The id of external output device
  * @param[in] win  The pointer of evas object
@@ -480,7 +510,8 @@ int eom_set_output_attribute(eom_output_id output_id, eom_output_attribute_e att
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #EOM_ERROR_NO_SUCH_DEVICE Invalid external output instance
- * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM module
+ * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM
+ *               module
  * @retval #EOM_ERROR_MESSAGE_OPERATION_FAILURE Operation failure
  * @pre eom_init()
  * @pre eom_get_eom_output_ids()
index df834cc..a3b84e9 100644 (file)
@@ -1,35 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-JunKyeong Kim <jk0430.kim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_INTERNAL_H__
index 0abf6c7..bcd71c9 100644 (file)
@@ -1,36 +1,36 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
-
 #include <config.h>
 
 #include "eom.h"
index f5dc38a..bd4b073 100755 (executable)
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #include <config.h>
@@ -111,52 +112,61 @@ _eom_dbus_convert_gvalue_to_message(GArray *array, DBusMessage *msg)
 
                switch (type) {
                case G_TYPE_INT:
-                       {
-                               int integer = g_value_get_int(v);
-
-                               if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &integer)) {
-                                       ERR("[EOM_CLIENT:%s] failed: int append", client_info.name);
-                                       return 0;
-                               }
+               {
+                       int integer = g_value_get_int(v);
+
+                       if (!dbus_message_iter_append_basic(&iter,
+                               DBUS_TYPE_INT32, &integer)) {
+                               ERR("[EOM_CLIENT:%s] failed: int append",
+                                       client_info.name);
+                               return 0;
                        }
+               }
                        break;
                case G_TYPE_UINT:
-                       {
-                               unsigned int uinteger = g_value_get_uint(v);
-
-                               if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &uinteger)) {
-                                       ERR("[EOM_CLIENT:%s] failed: uint append", client_info.name);
-                                       return 0;
-                               }
+               {
+                       unsigned int uinteger = g_value_get_uint(v);
+
+                       if (!dbus_message_iter_append_basic(&iter,
+                               DBUS_TYPE_UINT32, &uinteger)) {
+                               ERR("[EOM_CLIENT:%s] failed: uint append",
+                                       client_info.name);
+                               return 0;
                        }
+               }
                        break;
                case G_TYPE_STRING:
-                       {
-                               char *string = (char *)g_value_get_string(v);
-
-                               if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, (void *)&string)) {
-                                       ERR("[EOM_CLIENT:%s] failed: uint append", client_info.name);
-                                       return 0;
-                               }
+               {
+                       char *string = (char *)g_value_get_string(v);
+
+                       if (!dbus_message_iter_append_basic(&iter,
+                               DBUS_TYPE_STRING, (void *)&string)) {
+                               ERR("[EOM_CLIENT:%s] failed: uint append",
+                                       client_info.name);
+                               return 0;
                        }
+               }
                        break;
                case G_TYPE_VARIANT:
-                       {
-                               GVariant *variant = g_value_get_variant(v);
-                               int data_size = g_variant_get_size(variant);
-                               void *data = (void *)g_variant_get_data(variant);
-                               DBusMessageIter sub;
-
-                               RETV_IF_FAIL(data != NULL, 0);
-                               RETV_IF_FAIL(data_size > 0, 0);
-
-                               dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "y", &sub);
-                               if (!dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, (void *)&data, data_size)) {
-                                       ERR("[EOM_CLIENT:%s] failed: uint append", client_info.name);
-                                       return 0;
-                               }
-                               dbus_message_iter_close_container(&iter, &sub);
+               {
+                       GVariant *variant = g_value_get_variant(v);
+                       int data_size = g_variant_get_size(variant);
+                       void *data = (void *)g_variant_get_data(variant);
+                       DBusMessageIter sub;
+
+                       RETV_IF_FAIL(data != NULL, 0);
+                       RETV_IF_FAIL(data_size > 0, 0);
+
+                       dbus_message_iter_open_container(&iter,
+                               DBUS_TYPE_ARRAY, "y", &sub);
+                       if (!dbus_message_iter_append_fixed_array(&sub,
+                               DBUS_TYPE_BYTE, (void *)&data, data_size)) {
+                               ERR("[EOM_CLIENT:%s] failed: uint append",
+                                       client_info.name);
+                               return 0;
                        }
+                       dbus_message_iter_close_container(&iter, &sub);
+               }
                        break;
                default:
                        return 0;
@@ -181,45 +191,50 @@ _eom_dbus_convert_message_to_gvalue(DBusMessage *msg)
                int type = dbus_message_iter_get_arg_type(&iter);
                GValue v = G_VALUE_INIT;
 
-               INFO("[EOM_CLIENT:%s] type(%c(%d))", client_info.name, (char)type, type);
+               INFO("[EOM_CLIENT:%s] type(%c(%d))",
+                       client_info.name, (char)type, type);
 
                switch (type) {
                case DBUS_TYPE_INT32:
-                       {
-                               int integer = 0;
-                               dbus_message_iter_get_basic(&iter, &integer);
-                               g_value_init(&v, G_TYPE_INT);
-                               g_value_set_int(&v, integer);
-                               array = g_array_append_val(array, v);
-                               g_value_unset(&v);
-                       }
+               {
+                       int integer = 0;
+
+                       dbus_message_iter_get_basic(&iter, &integer);
+                       g_value_init(&v, G_TYPE_INT);
+                       g_value_set_int(&v, integer);
+                       array = g_array_append_val(array, v);
+                       g_value_unset(&v);
+               }
                        break;
                case DBUS_TYPE_UINT32:
-                       {
-                               unsigned int uinteger = 0;
-                               dbus_message_iter_get_basic(&iter, &uinteger);
-                               g_value_init(&v, G_TYPE_UINT);
-                               g_value_set_uint(&v, uinteger);
-                               array = g_array_append_val(array, v);
-                               g_value_unset(&v);
-                       }
+               {
+                       unsigned int uinteger = 0;
+
+                       dbus_message_iter_get_basic(&iter, &uinteger);
+                       g_value_init(&v, G_TYPE_UINT);
+                       g_value_set_uint(&v, uinteger);
+                       array = g_array_append_val(array, v);
+                       g_value_unset(&v);
+               }
                        break;
                case DBUS_TYPE_STRING:
-                       {
-                               char *string = NULL;
-                               dbus_message_iter_get_basic(&iter, &string);
-                               g_value_init(&v, G_TYPE_STRING);
-                               g_value_set_string(&v, string);
-                               array = g_array_append_val(array, v);
-                               g_value_unset(&v);
-                       }
+               {
+                       char *string = NULL;
+
+                       dbus_message_iter_get_basic(&iter, &string);
+                       g_value_init(&v, G_TYPE_STRING);
+                       g_value_set_string(&v, string);
+                       array = g_array_append_val(array, v);
+                       g_value_unset(&v);
+               }
                        break;
                default:
                        NEVER_GET_HERE();
                        g_array_free(array, FALSE);
                        return NULL;
                }
-       } while (dbus_message_iter_has_next(&iter) && dbus_message_iter_next(&iter));
+       } while (dbus_message_iter_has_next(&iter) &&
+               dbus_message_iter_next(&iter));
 
        return array;
 }
@@ -241,7 +256,8 @@ _eom_dbus_client_process_message(EomDBusClientInfo *info, DBusMessage *msg)
                EomDBusClientMethod *method = *prev;
 
                if (!strcmp(dbus_message_get_member(msg), method->name)) {
-                       GArray *array = _eom_dbus_convert_message_to_gvalue(msg);
+                       GArray *array =
+                               _eom_dbus_convert_message_to_gvalue(msg);
 
                        if (method->func)
                                method->func(method->data, array);
@@ -278,7 +294,8 @@ _eom_dbus_client_cb(GIOChannel *src, GIOCondition cond, gpointer data)
 
 
 static DBusHandlerResult
-_eom_dbus_client_msg_handler(DBusConnection *connection, DBusMessage *msg, void *data)
+_eom_dbus_client_msg_handler(DBusConnection *connection,
+               DBusMessage *msg, void *data)
 {
        EomDBusClientInfo *info = (EomDBusClientInfo *)data;
 
@@ -316,7 +333,9 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
 {
        DBusError err;
        int ret;
-       DBusObjectPathVTable vtable = {.message_function = _eom_dbus_client_msg_handler, };
+       DBusObjectPathVTable vtable = {
+               .message_function = _eom_dbus_client_msg_handler,
+       };
        GIOChannel *channel;
 
        dbus_error_init(&err);
@@ -335,7 +354,8 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
                goto free_err;
        }
 
-       ret = dbus_bus_request_name(info->conn, info->name, DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
+       ret = dbus_bus_request_name(info->conn,
+               info->name, DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
        if (dbus_error_is_set(&err)) {
                ERR("[EOM] failed: request name (%s)", err.message);
                goto free_conn;
@@ -345,7 +365,8 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
                goto free_conn;
        }
 
-       snprintf(info->rule, sizeof(info->rule), "interface='%s'", EOM_DBUS_INTERFACE);
+       snprintf(info->rule, sizeof(info->rule),
+               "interface='%s'", EOM_DBUS_INTERFACE);
 
        dbus_bus_add_match(info->conn, info->rule, &err);
        dbus_connection_flush(info->conn);
@@ -354,19 +375,22 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
                goto free_name;
        }
 
-       if (!dbus_connection_register_object_path(info->conn, EOM_DBUS_PATH, &vtable, info)) {
+       if (!dbus_connection_register_object_path(info->conn,
+               EOM_DBUS_PATH, &vtable, info)) {
                ERR("[EOM] failed: register object path");
                goto free_match;
        }
 
        dbus_connection_set_exit_on_disconnect(info->conn, FALSE);
 
-       if (!dbus_connection_add_filter(info->conn, _eom_dbus_client_msg_filter, info, NULL)) {
+       if (!dbus_connection_add_filter(info->conn,
+               _eom_dbus_client_msg_filter, info, NULL)) {
                ERR("[EOM] failed: add filter (%s)", err.message);
                goto free_register;
        }
 
-       if (!dbus_connection_get_unix_fd(info->conn, &info->fd) || info->fd < 0) {
+       if (!dbus_connection_get_unix_fd(info->conn,
+               &info->fd) || info->fd < 0) {
                ERR("[EOM] failed: get fd");
                goto free_filter;
        }
@@ -377,7 +401,8 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
        g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL);
 
        info->src = g_io_create_watch(channel, G_IO_IN);
-       g_source_set_callback(info->src, (GSourceFunc)_eom_dbus_client_cb, (gpointer)info, NULL);
+       g_source_set_callback(info->src,
+               (GSourceFunc)_eom_dbus_client_cb, (gpointer)info, NULL);
        g_source_attach(info->src, NULL);
 
        g_io_channel_unref(channel);
@@ -387,7 +412,8 @@ _eom_dbus_client_initialize(EomDBusClientInfo *info)
        return 1;
 
 free_filter:
-       dbus_connection_remove_filter(info->conn, _eom_dbus_client_msg_filter, info);
+       dbus_connection_remove_filter(info->conn,
+               _eom_dbus_client_msg_filter, info);
 free_register:
        dbus_connection_unregister_object_path(info->conn, EOM_DBUS_PATH);
 free_match:
@@ -462,7 +488,8 @@ _eom_dbus_client_add_method(EomDBusClientMethod *method)
 {
        EomDBusClientMethod **prev;
 
-       for (prev = &client_info.methods; *prev; prev = &(*prev)->next);
+       for (prev = &client_info.methods; *prev; prev = &(*prev)->next)
+               ;
 
        method->next = NULL;
        *prev = method;
@@ -510,9 +537,10 @@ eom_dbus_client_deinit(GList *cb_info_list)
        if (!dbus_initialized)
                return;
 
-       /* An output instance and a callback can be created and be added only by user.
-        * If there is cb_info_list, it means that user is still
-        * watching and interested with eom dbus message.
+       /* An output instance and a callback can be created
+        * and be added only by user. If there is cb_info_list,
+        * it means that user is still watching and interested
+        * with eom dbus message.
         */
        if (cb_info_list)
                return;
@@ -535,19 +563,23 @@ eom_dbus_client_send_message(char *method, GArray *array)
 
        dbus_error_init(&err);
 
-       msg = dbus_message_new_method_call(EOM_DBUS_SERVER, EOM_DBUS_PATH, EOM_DBUS_INTERFACE, method);
+       msg = dbus_message_new_method_call(EOM_DBUS_SERVER,
+               EOM_DBUS_PATH, EOM_DBUS_INTERFACE, method);
        GOTO_IF_FAIL(msg != NULL, err_send);
 
        INFO("[EOM_CLIENT:%s] Send message(%s)", client_info.name, method);
 
        if (!_eom_dbus_convert_gvalue_to_message(array, msg)) {
-               ERR("[EOM_CLIENT:%s] failed: gvalue_to_message", client_info.name);
+               ERR("[EOM_CLIENT:%s] failed: gvalue_to_message",
+                       client_info.name);
                goto err_send;
        }
 
-       reply_msg = dbus_connection_send_with_reply_and_block(client_info.conn, msg, REPLY_TIME, &err);
+       reply_msg = dbus_connection_send_with_reply_and_block(client_info.conn,
+               msg, REPLY_TIME, &err);
        if (dbus_error_is_set(&err)) {
-               ERR("[EOM_CLIENT:%s] failed: send (%s)", client_info.name, err.message);
+               ERR("[EOM_CLIENT:%s] failed: send (%s)",
+                       client_info.name, err.message);
                goto err_send;
        }
        GOTO_IF_FAIL(reply_msg != NULL, err_send);
@@ -610,7 +642,8 @@ fail:
 }
 
 GArray *
-eom_dbus_client_set_attribute(eom_output_id output_id, eom_output_attribute_e attr)
+eom_dbus_client_set_attribute(eom_output_id output_id,
+               eom_output_attribute_e attr)
 {
        GArray *array = NULL;
        GArray *msg_array;
@@ -680,6 +713,7 @@ eom_dbus_client_set_window(eom_output_id output_id, Evas_Object *win)
 
 #ifdef HAVE_TIZEN_2_X
        const char *profile = "desktop";
+
        elm_win_profiles_set(win, &profile, 1);
 #endif
        elm_win_fullscreen_set(win, EINA_TRUE);
old mode 100755 (executable)
new mode 100644 (file)
index 6f4697c..d97c5df
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_DBUS_H__
@@ -45,7 +46,8 @@ void eom_dbus_client_deinit(GList *cb_info_list);
 
 GArray *eom_dbus_client_get_output_ids(void);
 GArray *eom_dbus_client_get_output_info(eom_output_id output_id);
-GArray *eom_dbus_client_set_attribute(eom_output_id output_id, eom_output_attribute_e attry);
+GArray *eom_dbus_client_set_attribute(eom_output_id output_id,
+                                       eom_output_attribute_e attry);
 GArray *eom_dbus_client_set_window(eom_output_id output_id, Evas_Object *win);
 
 GArray *eom_dbus_client_send_message(char *method, GArray *array);
index 01e6818..0ceecd8 100644 (file)
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_LOG_H__
@@ -54,30 +55,72 @@ static inline void set_last_result(int i) {; }
 #ifdef HAVE_DLOG
 #define LOG_TAG        "EOM"
 #include <dlog.h>
-#define INFO(fmt, arg...)  \
-       if (eom_debug_on) SECURE_SLOGI(fmt, ##arg)
-#define WARN(fmt, arg...)  \
-       if (eom_debug_on) SECURE_SLOGW(fmt, ##arg)
+#define INFO(fmt, arg...)  {if (eom_debug_on) SECURE_SLOGI(fmt, ##arg)}
+#define WARN(fmt, arg...)  {if (eom_debug_on) SECURE_SLOGW(fmt, ##arg)}
 #define ERR(fmt, arg...)   SECURE_SLOGE(fmt, ##arg)
-#define ERRNO(fmt, arg...) SECURE_SLOGE("(err=%s(%d)) "fmt, strerror(errno), errno, ##arg)
+#define ERRNO(fmt, arg...) SECURE_SLOGE("(err=%s(%d)) "fmt,\
+                                               strerror(errno), errno, ##arg)
 #define FATAL(fmt, arg...) SECURE_SLOGF(fmt, ##arg)
 #else  /* HAVE_DLOG */
 #include <stdlib.h>
-#define INFO(fmt, arg...)  \
-       if (eom_debug_on) fprintf(stdout, "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__, ##arg)
-#define WARN(fmt, arg...)  \
-       if (eom_debug_on) fprintf(stderr, "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__, ##arg)
-#define ERR(fmt, arg...)   fprintf(stderr, "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__, ##arg)
-#define ERRNO(fmt, arg...) fprintf(stderr, "[%s:%d](err=%s(%d)) "fmt"\n", __FUNCTION__, __LINE__, strerror(errno), errno, ##arg)
-#define FATAL(fmt, arg...) fprintf(stderr, "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__, ##arg)
+#define INFO(fmt, arg...)\
+       {\
+               if (eom_debug_on)\
+                       fprintf(stdout, "[%s:%d] "fmt"\n",\
+                               __func__, __LINE__, ##arg);\
+       }
+#define WARN(fmt, arg...)\
+       {\
+               if (eom_debug_on)\
+                       fprintf(stderr, "[%s:%d] "fmt"\n",\
+                               __func__, __LINE__, ##arg);\
+       }
+#define ERR(fmt, arg...)\
+               fprintf(stderr, "[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
+#define ERRNO(fmt, arg...)\
+               fprintf(stderr, "[%s:%d](err=%s(%d)) "fmt"\n",\
+                       __func__, __LINE__, strerror(errno), errno, ##arg)
+#define FATAL(fmt, arg...)\
+               fprintf(stderr, "[%s:%d] "fmt"\n",\
+                       __func__, __LINE__, ##arg)
 #endif  /* HAVE_DLOG */
 
-#define WARN_IF_FAIL(cond)                             if (!(cond)) ERR("'%s' failed", #cond);
-#define RET_IF_FAIL(cond)                              {if (!(cond)) { ERR("'%s' failed", #cond); return; } }
-#define RETV_IF_FAIL(cond, val)                        {if (!(cond)) { ERR("'%s' failed", #cond); return val; } }
-#define RETV_IF_ERRNO(cond, val, errno)        {if (!(cond)) { ERRNO("'%s' failed", #cond); return val; } }
-#define GOTO_IF_FAIL(cond, dst)                        {if (!(cond)) { ERR("'%s' failed", #cond); goto dst; } }
-#define GOTO_IF_ERRNO(cond, dst, errno)        {if (!(cond)) { ERRNO("'%s' failed", #cond); goto dst; } }
-#define NEVER_GET_HERE()                               ERR("** NEVER GET HERE **\n")
+#define WARN_IF_FAIL(cond)\
+       {\
+               if (!(cond))\
+                       ERR("'%s' failed", #cond);\
+       }
+#define RET_IF_FAIL(cond)\
+       {\
+               if (!(cond))\
+                       ERR("'%s' failed", #cond);\
+               return;\
+       }
+#define RETV_IF_FAIL(cond, val)\
+       {\
+               if (!(cond))\
+                       ERR("'%s' failed", #cond);\
+               return val;\
+       }
+#define RETV_IF_ERRNO(cond, val, errno)\
+       {\
+               if (!(cond))\
+                       ERRNO("'%s' failed", #cond);\
+               return val;\
+       }
+#define GOTO_IF_FAIL(cond, dst)\
+       {\
+               if (!(cond))\
+                       ERR("'%s' failed", #cond);\
+               goto dst;\
+       }
+#define GOTO_IF_ERRNO(cond, dst, errno)\
+       {\
+               if (!(cond))\
+                       ERRNO("'%s' failed", #cond);\
+               goto dst;\
+       }
+#define NEVER_GET_HERE()\
+       ERR("** NEVER GET HERE **\n")
 
 #endif /* __EOM_LOG_H__ */
old mode 100755 (executable)
new mode 100644 (file)
index 64cae84..76ad542
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_PRIVATE_H__
index 258d511..2b0d7ab 100755 (executable)
--- a/src/eom.c
+++ b/src/eom.c
@@ -1,34 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-Boram Park <boram1288.park@samsung.com>
-Changyeon Lee <cyeon.lee@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #include <config.h>
@@ -71,18 +72,27 @@ typedef struct {
 } eom_output_notify_mode_change_s;
 
 typedef struct {
-       eom_output_notify_type_e     type;        /**< External output type */
-       eom_output_id                output_id;   /**< External output id */
-       eom_output_attribute_e       attribute;   /**< External output attribute */
-       eom_output_attribute_state_e attr_state;  /**< External output attribute state */
+    /**< External output type */
+       eom_output_notify_type_e     type;
+       /**< External output id */
+       eom_output_id                output_id;
+       /**< External output attribute */
+       eom_output_attribute_e       attribute;
+       /**< External output attribute state */
+       eom_output_attribute_state_e attr_state;
 } eom_output_notify_attribute_change_s;
 
 typedef union {
-       eom_output_notify_base_s             base;           /**< Base structure for eom notify */
-       eom_output_notify_add_s              output_add;     /**< #EOM_OUTPUT_NOTIFY_ADD notify */
-       eom_output_notify_remove_s           output_remove;  /**< #EOM_OUTPUT_NOTIFY_REMOVE notify */
-       eom_output_notify_mode_change_s      mode_change;    /**< #EOM_OUTPUT_NOTIFY_MODE_CHANGED notify */
-       eom_output_notify_attribute_change_s attr_change;    /**< #EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED notify */
+    /**< Base structure for eom notify */
+       eom_output_notify_base_s             base;
+       /**< #EOM_OUTPUT_NOTIFY_ADD notify */
+       eom_output_notify_add_s              output_add;
+       /**< #EOM_OUTPUT_NOTIFY_REMOVE notify */
+       eom_output_notify_remove_s           output_remove;
+       /**< #EOM_OUTPUT_NOTIFY_MODE_CHANGED notify */
+       eom_output_notify_mode_change_s      mode_change;
+       /**< #EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED notify */
+       eom_output_notify_attribute_change_s attr_change;
 } eom_output_notify_s;
 
 typedef struct {
@@ -165,7 +175,7 @@ _eom_get_debug_evn(void)
 static bool
 _eom_mutex_init(void)
 {
-       static bool init = false;
+       static bool init;
 
        if (init)
                return true;
@@ -196,7 +206,8 @@ _eom_mutex_unlock(void)
 }
 
 static void
-_eom_set_output_info_mode(eom_output_info *output_info, int output_mode)
+_eom_set_output_info_mode(eom_output_info *output_info,
+               int output_mode)
 {
        RET_IF_FAIL(output_info != NULL);
 
@@ -207,7 +218,8 @@ _eom_set_output_info_mode(eom_output_info *output_info, int output_mode)
 }
 
 static void
-_eom_set_output_attribute(eom_output_info *output_info, eom_output_attribute_e attribute)
+_eom_set_output_attribute(eom_output_info *output_info,
+               eom_output_attribute_e attribute)
 {
        RET_IF_FAIL(output_info != NULL);
 
@@ -215,7 +227,8 @@ _eom_set_output_attribute(eom_output_info *output_info, eom_output_attribute_e a
 }
 
 static void
-_eom_set_output_attribute_state(eom_output_info *output_info, eom_output_attribute_state_e state)
+_eom_set_output_attribute_state(eom_output_info *output_info,
+               eom_output_attribute_state_e state)
 {
        RET_IF_FAIL(output_info != NULL);
 
@@ -223,7 +236,8 @@ _eom_set_output_attribute_state(eom_output_info *output_info, eom_output_attribu
 }
 
 static void
-_eom_set_output_info_size(eom_output_info *output_info, int w, int h)
+_eom_set_output_info_size(eom_output_info *output_info,
+               int w, int h)
 {
        RET_IF_FAIL(output_info != NULL);
 
@@ -232,7 +246,8 @@ _eom_set_output_info_size(eom_output_info *output_info, int w, int h)
 }
 
 static void
-_eom_set_output_info_phy_size(eom_output_info *output_info, int w_mm, int h_mm)
+_eom_set_output_info_phy_size(eom_output_info *output_info,
+               int w_mm, int h_mm)
 {
        RET_IF_FAIL(output_info != NULL);
 
@@ -258,7 +273,8 @@ _eom_output_call_notify_cb(eom_output_notify_s *notify)
        GList *l;
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
                if (!cb_info || cb_info->type != notify->base.type)
                        continue;
@@ -267,32 +283,43 @@ _eom_output_call_notify_cb(eom_output_notify_s *notify)
                        if (cb_info->add_func == NULL)
                                continue;
 
-                       INFO("cb_info: type(%d) output_id(%d)", notify->base.type, notify->base.output_id);
+                       INFO("cb_info: type(%d) output_id(%d)",
+                               notify->base.type, notify->base.output_id);
 
-                       cb_info->add_func(notify->base.output_id, cb_info->user_data);
+                       cb_info->add_func(notify->base.output_id,
+                               cb_info->user_data);
                } else if (notify->base.type == EOM_OUTPUT_NOTIFY_REMOVE) {
                        if (cb_info->remove_func == NULL)
                                continue;
 
-                       INFO("cb_info: type(%d) output_id(%d)", notify->base.type, notify->base.output_id);
+                       INFO("cb_info: type(%d) output_id(%d)",
+                               notify->base.type, notify->base.output_id);
 
-                       cb_info->remove_func(notify->base.output_id, cb_info->user_data);
-               } else if (notify->base.type == EOM_OUTPUT_NOTIFY_MODE_CHANGED) {
+                       cb_info->remove_func(notify->base.output_id,
+                               cb_info->user_data);
+               } else if (notify->base.type ==
+                       EOM_OUTPUT_NOTIFY_MODE_CHANGED) {
                        if (cb_info->mode_change_func == NULL)
                                continue;
 
-                       INFO("cb_info: type(%d) output_id(%d)", notify->base.type, notify->base.output_id);
+                       INFO("cb_info: type(%d) output_id(%d)",
+                               notify->base.type, notify->base.output_id);
 
-                       cb_info->mode_change_func(notify->base.output_id, cb_info->user_data);
-               } else if (notify->base.type == EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED) {
+                       cb_info->mode_change_func(notify->base.output_id,
+                               cb_info->user_data);
+               } else if (notify->base.type ==
+                       EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED) {
                        if (cb_info->attribute_change_func == NULL)
                                continue;
 
-                       INFO("cb_info: type(%d) output_id(%d)", notify->base.type, notify->base.output_id);
+                       INFO("cb_info: type(%d) output_id(%d)",
+                               notify->base.type, notify->base.output_id);
 
-                       cb_info->attribute_change_func(notify->base.output_id, cb_info->user_data);
+                       cb_info->attribute_change_func(notify->base.output_id,
+                               cb_info->user_data);
                } else {
-                       INFO("cb_info: type(%d) output_id(%d)", notify->base.type, notify->base.output_id);
+                       INFO("cb_info: type(%d) output_id(%d)",
+                               notify->base.type, notify->base.output_id);
                        continue;
                }
        }
@@ -303,13 +330,16 @@ _eom_output_process_notify_cb(void *data, GArray *array)
 {
        eom_output_notify_s notify;
        eom_output_info *output_info;
-       int notify_type, output_id, output_type, output_mode, w, h, w_mm, h_mm, pid, attr, state;
+       int notify_type, output_id, output_type, output_mode;
+       int w, h, w_mm, h_mm, pid, attr, state;
        GValue *v;
 
        RET_IF_FAIL(array != NULL);
        RET_IF_FAIL(array->len == 11);
 
-       /* 11 args 0: notify_type 1:output_id, 2:output_type, 3:output_mode, 4:w, 5:h, 6:w_mm, 7:h_mm, 8:pid, 9:attr, 10:state */
+/* 11 args 0: notify_type 1:output_id, 2:output_type, 3:output_mode,
+  *             4:w, 5:h, 6:w_mm, 7:h_mm, 8:pid, 9:attr, 10:state
+  */
        v = &g_array_index(array, GValue, 0);
        notify_type = g_value_get_int(v);
        v = &g_array_index(array, GValue, 1);
@@ -334,7 +364,8 @@ _eom_output_process_notify_cb(void *data, GArray *array)
        state = g_value_get_int(v);
 
        INFO("notify: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
-               notify_type, output_id, output_type, output_mode, w, h, w_mm, h_mm, pid, attr, state);
+               notify_type, output_id, output_type, output_mode,
+               w, h, w_mm, h_mm, pid, attr, state);
 
        memset(&notify, 0, sizeof(eom_output_notify_s));
        notify.base.type = notify_type;
@@ -380,7 +411,8 @@ _eom_output_process_notify_cb(void *data, GArray *array)
                        output_info->output_mode = output_mode;
 
                        INFO("'%s(%d)' mode changed(%d=>%d)",
-                                       TYPE(output_type), output_id, old_mode, output_info->output_mode);
+                               TYPE(output_type), output_id,
+                               old_mode, output_info->output_mode);
 
                        notify.mode_change.old_mode = old_mode;
                        notify.mode_change.new_mode = output_info->output_mode;
@@ -392,25 +424,27 @@ _eom_output_process_notify_cb(void *data, GArray *array)
                break;
 
        case EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED:
-               {
-                       int current_pid = getpid();
-
-                       if (current_pid == pid) {
-                               INFO("'%s(%d)'pid(%d)", TYPE(output_type), output_id, pid);
-                               _eom_set_output_attribute(output_info, attr);
-                               _eom_set_output_attribute_state(output_info, state);
-                               notify.attr_change.output_id = output_id;
-                               notify.attr_change.attribute = attr;
-                               notify.attr_change.attr_state = state;
-
-                               _eom_mutex_unlock();
-                               _eom_output_call_notify_cb(&notify);
-                               _eom_mutex_lock();
-
-                               if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
-                                       _eom_set_output_attribute_state(output_info, EOM_OUTPUT_ATTRIBUTE_STATE_NONE);
-                       }
+       {
+               int current_pid = getpid();
+
+               if (current_pid == pid) {
+                       INFO("'%s(%d)'pid(%d)",
+                               TYPE(output_type), output_id, pid);
+                       _eom_set_output_attribute(output_info, attr);
+                       _eom_set_output_attribute_state(output_info, state);
+                       notify.attr_change.output_id = output_id;
+                       notify.attr_change.attribute = attr;
+                       notify.attr_change.attr_state = state;
+
+                       _eom_mutex_unlock();
+                       _eom_output_call_notify_cb(&notify);
+                       _eom_mutex_lock();
+
+                       if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
+                               _eom_set_output_attribute_state(output_info,
+                                       EOM_OUTPUT_ATTRIBUTE_STATE_NONE);
                }
+       }
                break;
 
        default:
@@ -517,6 +551,7 @@ eom_deinit(void)
        /* destory output_info. */
        for (l = output_info_list; l; l = g_list_next(l)) {
                eom_output_info *output_info = (eom_output_info *)l->data;
+
                output_info_list = g_list_remove(output_info_list, output_info);
 
                _eom_free_output_info(&output_info);
@@ -567,6 +602,7 @@ eom_get_eom_output_ids(int *count)
        *count = ret_array->len;
        for (i = 0; i < ret_array->len; i++) {
                GValue *v = &g_array_index(ret_array, GValue, i);
+
                output_ids[i] = g_value_get_int(v);
                INFO("output_ids: %d", output_ids[i]);
        }
@@ -590,18 +626,37 @@ eom_get_eom_output_ids(int *count)
                ret_array = eom_dbus_client_get_output_info(output_id);
 #endif
                if (ret_array) {
-                       /* 0:output_id, 1:output_type, 2:output_mode, 3:w, 4:h, 5:w_mm, 6:h_mm, 7:attribute */
-                       output_info = _eom_alloc_output_info(g_value_get_int(&g_array_index(ret_array, GValue, 0)),
-                                                                                                 g_value_get_int(&g_array_index(ret_array, GValue, 1)));
+               /*
+                 * 0:output_id, 1:output_type, 2:output_mode,
+                 * 3:w, 4:h, 5:w_mm, 6:h_mm, 7:attribute
+                 */
+                       output_info = _eom_alloc_output_info(
+                               g_value_get_int(&g_array_index(
+                                       ret_array, GValue, 0)),
+                               g_value_get_int(&g_array_index(
+                                       ret_array, GValue, 1)));
                        if (output_info) {
-                               output_info_list = g_list_append(output_info_list, output_info);
-                               _eom_set_output_info_mode(output_info, g_value_get_int(&g_array_index(ret_array, GValue, 2)));
-                               _eom_set_output_info_size(output_info, g_value_get_int(&g_array_index(ret_array, GValue, 3)),
-                                                                                                               g_value_get_int(&g_array_index(ret_array, GValue, 4)));
-                               _eom_set_output_info_phy_size(output_info, g_value_get_int(&g_array_index(ret_array, GValue, 5)),
-                                                                                                                       g_value_get_int(&g_array_index(ret_array, GValue, 6)));
-                               _eom_set_output_attribute(output_info, g_value_get_int(&g_array_index(ret_array, GValue, 7)));
-                               INFO("GetOutputInfo: %s(%d)", TYPE(output_info->type), output_info->id);
+                               output_info_list = g_list_append(
+                                       output_info_list, output_info);
+                               _eom_set_output_info_mode(output_info,
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 2)));
+                               _eom_set_output_info_size(output_info,
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 3)),
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 4)));
+                               _eom_set_output_info_phy_size(output_info,
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 5)),
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 6)));
+                               _eom_set_output_attribute(output_info,
+                                       g_value_get_int(&g_array_index(
+                                               ret_array, GValue, 7)));
+                               INFO("GetOutputInfo: %s(%d)",
+                                       TYPE(output_info->type),
+                                               output_info->id);
                        }
 
                        g_array_free(ret_array, FALSE);
@@ -640,9 +695,11 @@ eom_set_output_added_cb(eom_output_added_cb callback, void *user_data)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (cb_info && (cb_info->add_func != NULL) && (cb_info->add_func == callback)) {
+               if (cb_info && (cb_info->add_func != NULL) &&
+                               (cb_info->add_func == callback)) {
                        _eom_mutex_unlock();
                        return EOM_ERROR_NONE;
                }
@@ -677,9 +734,11 @@ eom_unset_output_added_cb(eom_output_added_cb callback)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (!cb_info || (cb_info->add_func == NULL) || (cb_info->add_func != callback))
+               if (!cb_info || (cb_info->add_func == NULL) ||
+                               (cb_info->add_func != callback))
                        continue;
 
                cb_info_list = g_list_remove(cb_info_list, cb_info);
@@ -706,9 +765,11 @@ eom_set_output_removed_cb(eom_output_removed_cb callback, void *user_data)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (cb_info && (cb_info->remove_func != NULL) && (cb_info->remove_func == callback)) {
+               if (cb_info && (cb_info->remove_func != NULL) &&
+                               (cb_info->remove_func == callback)) {
                        _eom_mutex_unlock();
                        return EOM_ERROR_NONE;
                }
@@ -743,9 +804,11 @@ eom_unset_output_removed_cb(eom_output_removed_cb callback)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (!cb_info || (cb_info->remove_func == NULL) || (cb_info->remove_func != callback))
+               if (!cb_info || (cb_info->remove_func == NULL) ||
+                               (cb_info->remove_func != callback))
                        continue;
 
                cb_info_list = g_list_remove(cb_info_list, cb_info);
@@ -772,9 +835,11 @@ eom_set_mode_changed_cb(eom_mode_changed_cb callback, void *user_data)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (cb_info && (cb_info->mode_change_func != NULL) && (cb_info->mode_change_func == callback)) {
+               if (cb_info && (cb_info->mode_change_func != NULL) &&
+                               (cb_info->mode_change_func == callback)) {
                        _eom_mutex_unlock();
                        return EOM_ERROR_NONE;
                }
@@ -809,9 +874,11 @@ eom_unset_mode_changed_cb(eom_mode_changed_cb callback)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (!cb_info || (cb_info->mode_change_func == NULL) || (cb_info->mode_change_func != callback))
+               if (!cb_info || (cb_info->mode_change_func == NULL) ||
+                               (cb_info->mode_change_func != callback))
                        continue;
 
                cb_info_list = g_list_remove(cb_info_list, cb_info);
@@ -838,9 +905,11 @@ eom_set_attribute_changed_cb(eom_attribute_changed_cb callback, void *user_data)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (cb_info && (cb_info->attribute_change_func != NULL) && (cb_info->attribute_change_func == callback)) {
+               if (cb_info && (cb_info->attribute_change_func != NULL) &&
+                               (cb_info->attribute_change_func == callback)) {
                        _eom_mutex_unlock();
                        return EOM_ERROR_NONE;
                }
@@ -875,9 +944,11 @@ eom_unset_attribute_changed_cb(eom_attribute_changed_cb callback)
        _eom_mutex_lock();
 
        for (l = cb_info_list; l; l = g_list_next(l)) {
-               eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
+               eom_output_notify_cb_info *cb_info =
+                       (eom_output_notify_cb_info *)l->data;
 
-               if (!cb_info || (cb_info->attribute_change_func == NULL) || (cb_info->attribute_change_func != callback))
+               if (!cb_info || (cb_info->attribute_change_func == NULL) ||
+                               (cb_info->attribute_change_func != callback))
                        continue;
 
                cb_info_list = g_list_remove(cb_info_list, cb_info);
@@ -894,15 +965,18 @@ eom_unset_attribute_changed_cb(eom_attribute_changed_cb callback)
 }
 
 API int
-eom_set_output_attribute(eom_output_id output_id, eom_output_attribute_e attr)
+eom_set_output_attribute(eom_output_id output_id,
+               eom_output_attribute_e attr)
 {
        eom_output_info *output_info = NULL;
        bool ret = false;
        GArray *ret_array;
 
        RETV_IF_FAIL(output_id != 0, EOM_ERROR_INVALID_PARAMETER);
-       RETV_IF_FAIL(attr > EOM_OUTPUT_ATTRIBUTE_NONE, EOM_ERROR_INVALID_PARAMETER);
-       RETV_IF_FAIL(attr < EOM_OUTPUT_ATTRIBUTE_MAX, EOM_ERROR_INVALID_PARAMETER);
+       RETV_IF_FAIL(attr > EOM_OUTPUT_ATTRIBUTE_NONE,
+               EOM_ERROR_INVALID_PARAMETER);
+       RETV_IF_FAIL(attr < EOM_OUTPUT_ATTRIBUTE_MAX,
+               EOM_ERROR_INVALID_PARAMETER);
 
        _eom_mutex_lock();
 
@@ -941,7 +1015,8 @@ eom_set_output_attribute(eom_output_id output_id, eom_output_attribute_e attr)
 
 
 API int
-eom_get_output_type(eom_output_id output_id, eom_output_type_e *type)
+eom_get_output_type(eom_output_id output_id,
+               eom_output_type_e *type)
 {
        eom_output_info *output_info = NULL;
 
@@ -965,7 +1040,8 @@ eom_get_output_type(eom_output_id output_id, eom_output_type_e *type)
 }
 
 API int
-eom_get_output_mode(eom_output_id output_id, eom_output_mode_e *mode)
+eom_get_output_mode(eom_output_id output_id,
+               eom_output_mode_e *mode)
 {
        eom_output_info *output_info = NULL;
 
@@ -989,7 +1065,8 @@ eom_get_output_mode(eom_output_id output_id, eom_output_mode_e *mode)
 }
 
 API int
-eom_get_output_attribute(eom_output_id output_id, eom_output_attribute_e *attribute)
+eom_get_output_attribute(eom_output_id output_id,
+               eom_output_attribute_e *attribute)
 {
        eom_output_info *output_info = NULL;
 
@@ -1013,7 +1090,8 @@ eom_get_output_attribute(eom_output_id output_id, eom_output_attribute_e *attrib
 }
 
 API int
-eom_get_output_attribute_state(eom_output_id output_id, eom_output_attribute_state_e *state)
+eom_get_output_attribute_state(eom_output_id output_id,
+               eom_output_attribute_state_e *state)
 {
        eom_output_info *output_info = NULL;
 
@@ -1068,7 +1146,8 @@ eom_get_output_resolution(eom_output_id output_id, int *width, int *height)
 }
 
 API int
-eom_get_output_physical_size(eom_output_id output_id, int *phy_width, int *phy_height)
+eom_get_output_physical_size(eom_output_id output_id,
+               int *phy_width, int *phy_height)
 {
        eom_output_info *output_info = NULL;
 
index 31bc2aa..1a97ca6 100644 (file)
@@ -1,32 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #include <config.h>
@@ -88,12 +91,13 @@ typedef struct _EomWaylandOutput {
 } EomWaylandOutput;
 
 static EomWaylandClientInfo wl_client_info;
-static int eom_wayland_init = 0;
+static int eom_wayland_init;
 
 static eom_output_type_e
 _convert_to_eom_output_type(enum wl_eom_type eom_type)
 {
        eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
+
        switch (eom_type) {
        case WL_EOM_TYPE_NONE:
                output_type = EOM_OUTPUT_TYPE_UNKNOWN;
@@ -102,7 +106,7 @@ _convert_to_eom_output_type(enum wl_eom_type eom_type)
                output_type = EOM_OUTPUT_TYPE_VGA;
                break;
        case WL_EOM_TYPE_DIVI:
-               output_type = EOM_OUTPUT_TYPE_DVII;;
+               output_type = EOM_OUTPUT_TYPE_DVII;
                break;
        case WL_EOM_TYPE_DIVD:
                output_type = EOM_OUTPUT_TYPE_DVID;
@@ -158,6 +162,7 @@ static eom_output_mode_e
 _convert_to_eom_output_mode(enum wl_eom_mode eom_mode)
 {
        eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
+
        switch (eom_mode) {
        case WL_EOM_MODE_NONE:
                output_mode = EOM_OUTPUT_MODE_NONE;
@@ -180,6 +185,7 @@ static eom_output_attribute_e
 _convert_to_eom_output_attribute(enum wl_eom_attribute eom_attribute)
 {
        eom_output_attribute_e output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+
        switch (eom_attribute) {
        case WL_EOM_ATTRIBUTE_NONE:
                output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
@@ -202,9 +208,12 @@ _convert_to_eom_output_attribute(enum wl_eom_attribute eom_attribute)
 }
 
 static eom_output_attribute_state_e
-_convert_to_eom_output_attribute_state(enum wl_eom_attribute_state eom_attribute_state)
+_convert_to_eom_output_attribute_state(
+               enum wl_eom_attribute_state eom_attribute_state)
 {
-       eom_output_attribute_state_e output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+       eom_output_attribute_state_e output_attribute_state =
+               EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+
        switch (eom_attribute_state) {
        case WL_EOM_ATTRIBUTE_STATE_NONE:
                output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
@@ -230,6 +239,7 @@ static enum wl_eom_attribute
 _convert_to_wl_eom_attribute(eom_output_attribute_e attr)
 {
        enum wl_eom_attribute eom_attribute = WL_EOM_ATTRIBUTE_NONE;
+
        switch (attr) {
        case EOM_OUTPUT_ATTRIBUTE_NONE:
                eom_attribute = WL_EOM_ATTRIBUTE_NONE;
@@ -253,14 +263,14 @@ _convert_to_wl_eom_attribute(eom_output_attribute_e attr)
 
 
 static void
-_eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output, eom_output_notify_type_e type)
+_eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output,
+               eom_output_notify_type_e type)
 {
        GArray *array = NULL;
        GValue v = G_VALUE_INIT;
 
        array = g_array_new(FALSE, FALSE, sizeof(GValue));
 
-       /* 11 args 0: notify_type 1:output_id, 2:output_type, 3:output_mode, 4:w, 5:h, 6:w_mm, 7:h_mm, 8:pid, 9:attri, 10:state */
        /* 0: notify_type */
        g_value_init(&v, G_TYPE_INT);
        g_value_set_int(&v, type);
@@ -275,13 +285,15 @@ _eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output, eom_output_noti
 
        /* 2:output_type */
        g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, _convert_to_eom_output_type(eom_wl_output->eom_type));
+       g_value_set_int(&v,
+               _convert_to_eom_output_type(eom_wl_output->eom_type));
        array = g_array_append_val(array, v);
        g_value_unset(&v);
 
        /* 3:output_mode */
        g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, _convert_to_eom_output_mode(eom_wl_output->eom_mode));
+       g_value_set_int(&v,
+               _convert_to_eom_output_mode(eom_wl_output->eom_mode));
        array = g_array_append_val(array, v);
        g_value_unset(&v);
 
@@ -317,13 +329,16 @@ _eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output, eom_output_noti
 
        /* 9:attri */
        g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, _convert_to_eom_output_attribute(eom_wl_output->eom_attribute));
+       g_value_set_int(&v,
+               _convert_to_eom_output_attribute(eom_wl_output->eom_attribute));
        array = g_array_append_val(array, v);
        g_value_unset(&v);
 
        /* 10:state */
        g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, _convert_to_eom_output_attribute_state(eom_wl_output->eom_attribute_state));
+       g_value_set_int(&v,
+               _convert_to_eom_output_attribute_state(
+                       eom_wl_output->eom_attribute_state));
        array = g_array_append_val(array, v);
        g_value_unset(&v);
 
@@ -337,7 +352,8 @@ _eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output, eom_output_noti
 
 
 static EomWaylandOutput *
-_eom_wayland_client_find_output_from_wl_output(struct wl_list *eom_wl_output_list, struct wl_output *output)
+_eom_wayland_client_find_output_from_wl_output(
+               struct wl_list *eom_wl_output_list, struct wl_output *output)
 {
        EomWaylandOutput *eom_wl_output = NULL;
        EomWaylandOutput *tmp = NULL;
@@ -345,7 +361,8 @@ _eom_wayland_client_find_output_from_wl_output(struct wl_list *eom_wl_output_lis
 
        /* remove all eom_wl_outputs */
        if (!wl_list_empty(eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output, tmp, eom_wl_output_list, link) {
+               wl_list_for_each_safe(eom_wl_output,
+                       tmp, eom_wl_output_list, link) {
                        if (eom_wl_output->output == output) {
                                ret = eom_wl_output;
                                break;
@@ -357,7 +374,8 @@ _eom_wayland_client_find_output_from_wl_output(struct wl_list *eom_wl_output_lis
 }
 
 static EomWaylandOutput *
-_eom_wayland_client_find_output_from_eom_output(struct wl_list *eom_wl_output_list, eom_output_id id)
+_eom_wayland_client_find_output_from_eom_output(
+               struct wl_list *eom_wl_output_list, eom_output_id id)
 {
        EomWaylandOutput *eom_wl_output = NULL;
        EomWaylandOutput *tmp = NULL;
@@ -365,7 +383,8 @@ _eom_wayland_client_find_output_from_eom_output(struct wl_list *eom_wl_output_li
 
        /* remove all eom_wl_outputs */
        if (!wl_list_empty(eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output, tmp, eom_wl_output_list, link) {
+               wl_list_for_each_safe(eom_wl_output,
+                       tmp, eom_wl_output_list, link) {
                        if (eom_wl_output->id == id) {
                                ret = eom_wl_output;
                                break;
@@ -391,8 +410,9 @@ _eom_wl_output_handle_geometry(void *data,
 {
        EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
 
-       INFO("wl_output:%p x:%d y:%d phy_w:%d phy_h:%d subpixel:%d make:%s model:%s transform:%d\n",
-               wl_output, x, y, physical_width, physical_height, subpixel, make, model, transform);
+       INFO("wl_output:%p x:%d y:%d phy(w:%d h:%d) p:%d m:%s model:%s t:%d\n",
+               wl_output, x, y, physical_width, physical_height,
+               subpixel, make, model, transform);
 
        /* save vaules if it is different before */
        if (eom_wl_output->x != x)
@@ -473,7 +493,8 @@ _eom_wl_eom_output_type(void *data,
        EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
        EomWaylandOutput *eom_wl_output = NULL;
 
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(&eom_client_info->eom_wl_output_list, output);
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output);
        RET_IF_FAIL(eom_wl_output != NULL);
 
        /* save the output type */
@@ -485,9 +506,11 @@ _eom_wl_eom_output_type(void *data,
                eom_wl_output->eom_status = status;
 
                if (status == WL_EOM_STATUS_CONNECTION)
-                       _eom_wayland_client_call_notify(eom_wl_output, EOM_OUTPUT_NOTIFY_ADD);
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_ADD);
                else if (status == WL_EOM_STATUS_DISCONNECTION)
-                       _eom_wayland_client_call_notify(eom_wl_output, EOM_OUTPUT_NOTIFY_REMOVE);
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_REMOVE);
        }
 }
 
@@ -500,14 +523,16 @@ _eom_wl_eom_output_mode(void *data,
        EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
        EomWaylandOutput *eom_wl_output = NULL;
 
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(&eom_client_info->eom_wl_output_list, output);
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output);
        RET_IF_FAIL(eom_wl_output != NULL);
 
        /* check the eom mode and call the notify */
        if (eom_wl_output->eom_mode != mode) {
                eom_wl_output->eom_mode = mode;
 
-               _eom_wayland_client_call_notify(eom_wl_output, EOM_OUTPUT_NOTIFY_MODE_CHANGED);
+               _eom_wayland_client_call_notify(eom_wl_output,
+                       EOM_OUTPUT_NOTIFY_MODE_CHANGED);
        }
 }
 
@@ -522,15 +547,18 @@ _eom_wl_eom_output_attribute(void *data,
        EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
        EomWaylandOutput *eom_wl_output = NULL;
 
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(&eom_client_info->eom_wl_output_list, output);
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output);
        RET_IF_FAIL(eom_wl_output != NULL);
 
        /* check the eom attribute and call the notify */
-       if (eom_wl_output->eom_attribute != attribute || eom_wl_output->eom_attribute_state != attribute_state) {
+       if ((eom_wl_output->eom_attribute != attribute) ||
+               (eom_wl_output->eom_attribute_state != attribute_state)) {
                eom_wl_output->eom_attribute = attribute;
                eom_wl_output->eom_attribute_state = attribute_state;
 
-               _eom_wayland_client_call_notify(eom_wl_output, EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
+               _eom_wayland_client_call_notify(eom_wl_output,
+                       EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
        }
 }
 
@@ -543,7 +571,8 @@ static const struct wl_eom_listener eom_wl_eom_listener = {
 
 
 static void
-_eom_wl_registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
+_eom_wl_registry_handle_global(void *data, struct wl_registry *registry,
+               uint32_t name, const char *interface, uint32_t version)
 {
        EomWaylandClientInfo *ci = (EomWaylandClientInfo *)data;
        EomWaylandOutput *eom_wl_output = NULL;
@@ -551,7 +580,8 @@ _eom_wl_registry_handle_global(void *data, struct wl_registry *registry, uint32_
        struct wl_eom *eom = NULL;
 
        if (strcmp(interface, "wl_output") == 0) {
-               output = wl_registry_bind(registry, name, &wl_output_interface, 1);
+               output = wl_registry_bind(registry, name,
+                       &wl_output_interface, 1);
                if (!output)
                        ERR("Error. fail to bind  %s.\n", interface);
                else {
@@ -560,16 +590,18 @@ _eom_wl_registry_handle_global(void *data, struct wl_registry *registry, uint32_
                        /* create the eom_wl_output */
                        eom_wl_output = calloc(1, sizeof(EomWaylandOutput));
                        if (!eom_wl_output) {
-                               ERR("error. fail to allocate the eom_output.\n");
+                               ERR("Fail to allocate the eom_output.\n");
                                return;
                        }
                        ci->num_outputs++;
                        eom_wl_output->id = ci->num_outputs;
                        eom_wl_output->output = output;
-                       wl_list_insert(&ci->eom_wl_output_list, &eom_wl_output->link);
+                       wl_list_insert(&ci->eom_wl_output_list,
+                               &eom_wl_output->link);
 
                        /* add listener */
-                       wl_output_add_listener(eom_wl_output->output, &eom_wl_output_listener, eom_wl_output);
+                       wl_output_add_listener(eom_wl_output->output,
+                               &eom_wl_output_listener, eom_wl_output);
                }
        } else if (strcmp(interface, "wl_eom") == 0) {
                eom = wl_registry_bind(registry, name, &wl_eom_interface, 1);
@@ -588,7 +620,8 @@ _eom_wl_registry_handle_global(void *data, struct wl_registry *registry, uint32_
 }
 
 static void
-_eom_wl_registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
+_eom_wl_registry_handle_global_remove(void *data,
+               struct wl_registry *registry, uint32_t name)
 {
 
 }
@@ -612,11 +645,13 @@ _eom_wayland_client_initialize()
        GOTO_IF_FAIL(wl_client_info.display != NULL, fail);
 
        /* get the registry */
-       wl_client_info.registry = wl_display_get_registry(wl_client_info.display);
+       wl_client_info.registry =
+               wl_display_get_registry(wl_client_info.display);
        GOTO_IF_FAIL(wl_client_info.registry != NULL, fail);
 
        /* get the global objects */
-       wl_registry_add_listener(wl_client_info.registry, &eom_registry_listener, &wl_client_info);
+       wl_registry_add_listener(wl_client_info.registry,
+               &eom_registry_listener, &wl_client_info);
        wl_display_dispatch(wl_client_info.display);
        wl_display_roundtrip(wl_client_info.display);
 
@@ -625,7 +660,8 @@ _eom_wayland_client_initialize()
                EomWaylandOutput *eom_wl_output = NULL;
                EomWaylandOutput *tmp = NULL;
 
-               wl_list_for_each_safe(eom_wl_output, tmp, &wl_client_info.eom_wl_output_list, link) {
+               wl_list_for_each_safe(eom_wl_output, tmp,
+                       &wl_client_info.eom_wl_output_list, link) {
                        if (eom_wl_output->eom_type == WL_EOM_TYPE_NONE) {
                                WARN("[EOM_CLIENT] eom_type is NONE. remove.\n");
                                wl_output_destroy(eom_wl_output->output);
@@ -655,7 +691,8 @@ _eom_wayland_client_deinitialize()
 
        /* remove all eom_wl_outputs */
        if (!wl_list_empty(&wl_client_info.eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output, tmp, &wl_client_info.eom_wl_output_list, link) {
+               wl_list_for_each_safe(eom_wl_output, tmp,
+                       &wl_client_info.eom_wl_output_list, link) {
                        if (eom_wl_output->output)
                                wl_output_destroy(eom_wl_output->output);
                        free(eom_wl_output);
@@ -673,7 +710,8 @@ eom_wayland_client_init(notify_func func)
 {
        bool ret = false;
 
-       if (eom_wayland_init) return true;
+       if (eom_wayland_init)
+               return true;
 
        ret = _eom_wayland_client_initialize();
        GOTO_IF_FAIL(ret != false, fail);
@@ -716,7 +754,8 @@ eom_wayland_client_get_output_ids(void)
        array = g_array_new(FALSE, FALSE, sizeof(GValue));
 
        /* remove all eom_wl_outputs */
-       wl_list_for_each_safe(eom_wl_output, tmp, &wl_client_info.eom_wl_output_list, link) {
+       wl_list_for_each_safe(eom_wl_output, tmp,
+               &wl_client_info.eom_wl_output_list, link) {
                if (eom_wl_output->output) {
                        g_value_init(&v, G_TYPE_INT);
                        g_value_set_int(&v, eom_wl_output->id);
@@ -736,12 +775,12 @@ eom_wayland_client_get_output_info(eom_output_id output_id)
        GValue v = G_VALUE_INIT;
        EomWaylandOutput *eom_wl_output = NULL;
 
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(&wl_client_info.eom_wl_output_list, output_id);
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
        RETV_IF_FAIL(eom_wl_output != NULL, NULL);
 
        array = g_array_new(FALSE, FALSE, sizeof(GValue));
 
-       /* 0:output_id, 1:output_type, 2:output_mode, 3:w, 4:h, 5:w_mm, 6:h_mm */
        /* 0:output_id */
        g_value_init(&v, G_TYPE_INT);
        g_value_set_int(&v, eom_wl_output->id);
@@ -789,19 +828,25 @@ eom_wayland_client_get_output_info(eom_output_id output_id)
 }
 
 GArray *
-eom_wayland_client_set_attribute(eom_output_id output_id, eom_output_attribute_e attr)
+eom_wayland_client_set_attribute(eom_output_id output_id,
+               eom_output_attribute_e attr)
 {
        GArray *array = NULL;
        GValue v = G_VALUE_INIT;
        EomWaylandOutput *eom_wl_output = NULL;
        int ret = 0;
 
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(&wl_client_info.eom_wl_output_list, output_id);
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
        GOTO_IF_FAIL(eom_wl_output != NULL, fail);
 
-       wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->output, _convert_to_wl_eom_attribute(attr));
+       wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->output,
+               _convert_to_wl_eom_attribute(attr));
 
-       /* TODO: wait for the result of set_attribute. this should be the blocking call. */
+       /* TODO:
+         * wait for the result of set_attribute.
+         * this should be the blocking call.
+         */
        wl_display_dispatch(wl_client_info.display);
        wl_display_roundtrip(wl_client_info.display);
 
@@ -834,19 +879,21 @@ eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win)
        e_wl_win = elm_win_wl_window_get(win);
        GOTO_IF_FAIL(e_wl_win != NULL, fail);
 
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(&wl_client_info.eom_wl_output_list, output_id);
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
        GOTO_IF_FAIL(eom_wl_output != NULL, fail);
 
        /* set full screen at output */
        xdg_shell_surface = ecore_wl_window_xdg_surface_get(e_wl_win);
        if (xdg_shell_surface) {
-               xdg_surface_set_fullscreen(xdg_shell_surface, eom_wl_output->output);
+               xdg_surface_set_fullscreen(xdg_shell_surface,
+                       eom_wl_output->output);
        } else {
                shell_surface = ecore_wl_window_shell_surface_get(e_wl_win);
                if (shell_surface) {
                        wl_shell_surface_set_fullscreen(shell_surface,
-                                                                                 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
-                                                                                 0, eom_wl_output->output);
+                               WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
+                               0, eom_wl_output->output);
                } else {
                        ERR("no wl surface.\n");
                        goto fail;
old mode 100755 (executable)
new mode 100644 (file)
index 1c3d617..5385dea
@@ -1,32 +1,35 @@
 /**************************************************************************
-
-eom (external output manager)
-
-Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact:
-SooChan Lim <sc1.lim@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
 **************************************************************************/
 
 #ifndef __EOM_WAYLAND_H__
@@ -43,8 +46,10 @@ void eom_wayland_client_deinit(GList *cb_info_list);
 
 GArray *eom_wayland_client_get_output_ids(void);
 GArray *eom_wayland_client_get_output_info(eom_output_id output_id);
-GArray *eom_wayland_client_set_attribute(eom_output_id output_id, eom_output_attribute_e attry);
-GArray *eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win);
+GArray *eom_wayland_client_set_attribute(eom_output_id output_id,
+               eom_output_attribute_e attry);
+GArray *eom_wayland_client_set_window(eom_output_id output_id,
+               Evas_Object *win);
 
 
 #endif /* __EOM_WAYLAND_H__ */
index 9f91c45..147ac77 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef WL_EOM_CLIENT_PROTOCOL_H
 #define WL_EOM_CLIENT_PROTOCOL_H
 
-#ifdef  __cplusplus
+#ifdef __cplusplus
 extern "C" {
 #endif
 
@@ -216,13 +216,14 @@ wl_eom_destroy(struct wl_eom *wl_eom)
 }
 
 static inline void
-wl_eom_set_attribute(struct wl_eom *wl_eom, struct wl_output *output, uint32_t attribute)
+wl_eom_set_attribute(struct wl_eom *wl_eom, struct wl_output *output,
+               uint32_t attribute)
 {
        wl_proxy_marshal((struct wl_proxy *) wl_eom,
                         WL_EOM_SET_ATTRIBUTE, output, attribute);
 }
 
-#ifdef  __cplusplus
+#ifdef __cplusplus
 }
 #endif