【问题标题】:How to use Callback function to get Orientation in Tizen?如何使用回调函数在 Tizen 中获取方向?
【发布时间】:2012-08-12 19:45:45
【问题描述】:

我想用 c 编写一个本机应用程序来获取 Tizen 中的方向值。 编译后的 c 代码必须在 Tizen 手机上运行,​​我需要获取方向的值。我从 Tizen 源得到的回调函数是

int app_cb_broker_appcore_rotation_event(enum appcore_rm rm, void *data)
{
    app_device_orientation_cb device_orientation_cb;

    device_orientation_cb = app_context.callbacks->device_orientation;

    if (device_orientation_cb != NULL)
    {
            app_device_orientation_e dev_orientation;

            dev_orientation = app_convert_appcore_rm(rm);

            device_orientation_cb(dev_orientation, app_context.user_data);
    }

    return 0;
}

如何使用该函数获取当前方向的值?

【问题讨论】:

    标签: c linux tizen tizen-native-app


    【解决方案1】:

    查看头文件: https://review.tizen.org/git/?p=framework/appfw/app-core.git;a=blob;f=include/appcore-common.h;hb=HEAD

    看来您应该调用appcore_set_rotation_cb 来注册一个回调函数,以便在旋转发生变化时得到通知。如果您想获取现有状态,可以致电appcore_get_rotation_state

    头文件中包含的 API 文档中有一些示例代码。

    【讨论】:

      猜你喜欢
      • 2012-08-16
      • 2012-08-16
      • 1970-01-01
      • 2013-03-15
      • 2022-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多