commit bc2a646

Michael Forney  ·  2013-12-07 08:20:48 +0000 UTC
parent dc5cfc8
README: Use syntax highlighting in code snippets
1 files changed,  +23, -13
+23, -13
 1@@ -35,31 +35,41 @@ get called when a new window or screen is created. In `new_window`, you should
 2 allocate your own window window structure, and register a listener for the
 3 window's event signal. More information can be found in `swc.h`.
 4 
 5-    void new_window(struct swc_window * window)
 6-    {
 7-        /* TODO: Implement */
 8-    }
 9-
10-    void new_screen(struct swc_screen * screen)
11-    {
12-        /* TODO: Implement */
13-    }
14+```C
15+void new_window(struct swc_window * window)
16+{
17+    /* TODO: Implement */
18+}
19+
20+void new_screen(struct swc_screen * screen)
21+{
22+    /* TODO: Implement */
23+}
24+```
25 
26 Create a `struct swc_manager` containing pointers to these functions.
27 
28-    const struct swc_manager manager = { &new_window, &new_screen };
29+```C
30+const struct swc_manager manager = { &new_window, &new_screen };
31+```
32 
33 In your startup code, you must create a Wayland display.
34 
35-    display = wl_display_create();
36+```C
37+display = wl_display_create();
38+```
39 
40 Then call `swc_initialize`.
41 
42-    swc_initialize(display, NULL, manager);
43+```C
44+swc_initialize(display, NULL, manager);
45+```
46 
47 Finally, run the main event loop.
48 
49-    wl_display_run(display);
50+```C
51+wl_display_run(display);
52+```
53 
54 Why not write a Weston shell plugin?
55 ------------------------------------