From 88a6e232d7da3698dcbd903ad25ba4385a98e01d Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Thu, 3 Sep 2015 10:57:10 +0900 Subject: [PATCH] change concept of attribute (get attribute info when init, set attribute info when set_attribute) Change-Id: Ia734311f0d3677ce6ec59709b0d1cdd703906d06 Signed-off-by: Junkyeong Kim --- packaging/libeom.spec | 4 ++-- src/eom.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packaging/libeom.spec b/packaging/libeom.spec index da816e0..8533141 100644 --- a/packaging/libeom.spec +++ b/packaging/libeom.spec @@ -3,8 +3,8 @@ Name: libeom Summary: External Output Manager Library -Version: 1.0.1 -Release: 2 +Version: 1.0.2 +Release: 1 Group: Graphics/X Window System License: MIT Source0: %{name}-%{version}.tar.gz diff --git a/src/eom.c b/src/eom.c index f628d83..258d511 100755 --- a/src/eom.c +++ b/src/eom.c @@ -309,7 +309,7 @@ _eom_output_process_notify_cb(void *data, GArray *array) 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:attri, 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); @@ -406,6 +406,9 @@ _eom_output_process_notify_cb(void *data, GArray *array) _eom_mutex_unlock(); _eom_output_call_notify_cb(¬ify); _eom_mutex_lock(); + + if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST) + _eom_set_output_attribute_state(output_info, EOM_OUTPUT_ATTRIBUTE_STATE_NONE); } } break; @@ -587,7 +590,7 @@ 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 */ + /* 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) { @@ -597,6 +600,7 @@ eom_get_eom_output_ids(int *count) 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); } @@ -927,6 +931,9 @@ eom_set_output_attribute(eom_output_id output_id, eom_output_attribute_e attr) INFO("SetOutputAttribute: %s", (ret) ? "success" : "failed"); + if (ret) + _eom_set_output_attribute(output_info, attr); + _eom_mutex_unlock(); return (ret) ? EOM_ERROR_NONE : EOM_ERROR_MESSAGE_OPERATION_FAILURE; -- 2.7.4