方法
图书馆设备get_vendor_id
声明 [源]
const char*
gdk_device_get_vendor_id (
GdkDevice* device
)
描述 [源]
返回此设备的厂商ID。
该ID从设备中检索,不会改变。
此函数与 gdk_device_get_product_id()
一起使用,可用于生成存储此设备的设置的GSettings
路径等。
static GSettings *
get_device_settings (GdkDevice *device)
{
const char *vendor, *product;
GSettings *settings;
GdkDevice *device;
char *path;
vendor = gdk_device_get_vendor_id (device);
product = gdk_device_get_product_id (device);
path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product);
settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
g_free (path);
return settings;
}
获取属性 | 图书馆.设备:厂商-ID |