有人可以解释Pebble C Watchface教程中的部分代码吗?

eke*_*en4 4 c function shorthand pebble-watch pebble-sdk

我正在研究这里找到的Pebble C表面教程https://developer.getpebble.com/tutorials/watchface-tutorial/part1

有问题的代码部分在这里:

static void init() {
  // Create main Window element and assign to pointer
  s_main_window = window_create();

  // Set handlers to manage the elements inside the Window
  window_set_window_handlers(s_main_window, (WindowHandlers) {
    .load = main_window_load,
    .unload = main_window_unload
  });

  // Show the Window on the watch, with animated=true
  window_stack_push(s_main_window, true);
}
Run Code Online (Sandbox Code Playgroud)

window_set_window_handlers是一个函数声明和调用吗?C中的.load和.unload简写符号的术语是什么?

如果有人可以解释这段代码,我将非常感谢,谢谢.

huy*_*itw 5

它被称为指定初始化器.WindowHandlers在传递给函数调用之前,结构是在内联中创建和初始化的window_set_window_handlers.