commit cc21dfa

Michael Forney  ·  2014-01-01 07:07:26 +0000 UTC
parent 5db3c08
Explicitly export symbols
10 files changed,  +44, -1
M drm.c
M font.c
+1, -1
1@@ -74,7 +74,7 @@ WLD_PACKAGE_LIBS   ?= $(call pkgconfig,$(WLD_PACKAGES),libs,LIBS)
2 
3 CLEAN_FILES += $(WLD_STATIC_OBJECTS) $(WLD_SHARED_OBJECTS)
4 
5-FINAL_CFLAGS = $(CFLAGS) -std=c99
6+FINAL_CFLAGS = $(CFLAGS) -fvisibility=hidden -std=c99
7 FINAL_CPPFLAGS = $(CPPFLAGS) -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
8 
9 # Warning/error flags
+1, -0
1@@ -811,6 +811,7 @@ static const struct named_color named_colors[] = {
2     { "YellowGreen",            0xff9acd32 }
3 };
4 
5+EXPORT
6 bool wld_lookup_named_color(const char * name, uint32_t * color)
7 {
8     char * end;
+9, -0
 1@@ -60,18 +60,21 @@ void default_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
 2     }
 3 }
 4 
 5+EXPORT
 6 void wld_fill_rectangle(struct wld_drawable * drawable, uint32_t color,
 7                         int32_t x, int32_t y, uint32_t width, uint32_t height)
 8 {
 9     drawable->interface->fill_rectangle(drawable, color, x, y, width, height);
10 }
11 
12+EXPORT
13 void wld_fill_region(struct wld_drawable * drawable, uint32_t color,
14                      pixman_region32_t * region)
15 {
16     drawable->interface->fill_region(drawable, color, region);
17 }
18 
19+EXPORT
20 void wld_copy_rectangle(struct wld_drawable * src, struct wld_drawable * dst,
21                         int32_t src_x, int32_t src_y,
22                         int32_t dst_x, int32_t dst_y,
23@@ -82,6 +85,7 @@ void wld_copy_rectangle(struct wld_drawable * src, struct wld_drawable * dst,
24                                    width, height);
25 }
26 
27+EXPORT
28 void wld_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
29                      pixman_region32_t * region, int32_t dst_x, int32_t dst_y)
30 {
31@@ -89,6 +93,7 @@ void wld_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
32     dst->interface->copy_region(src, dst, region, dst_x, dst_y);
33 }
34 
35+EXPORT
36 void wld_draw_text_utf8_n(struct wld_drawable * drawable,
37                           struct wld_font * font_base, uint32_t color,
38                           int32_t x, int32_t y,
39@@ -101,21 +106,25 @@ void wld_draw_text_utf8_n(struct wld_drawable * drawable,
40                                         text, length, extents);
41 }
42 
43+EXPORT
44 void wld_destroy_drawable(struct wld_drawable * drawable)
45 {
46     drawable->interface->destroy(drawable);
47 }
48 
49+EXPORT
50 void wld_write(struct wld_drawable * drawable, const void * data, size_t size)
51 {
52     drawable->interface->write(drawable, data, size);
53 }
54 
55+EXPORT
56 pixman_image_t * wld_map(struct wld_drawable * drawable)
57 {
58     return drawable->interface->map(drawable);
59 }
60 
61+EXPORT
62 void wld_flush(struct wld_drawable * drawable)
63 {
64     drawable->interface->flush(drawable);
M drm.c
+8, -0
 1@@ -84,6 +84,7 @@ void drm_finalize_context(struct wld_drm_context * drm)
 2     drm->interface->destroy_context(drm->context);
 3 }
 4 
 5+EXPORT
 6 struct wld_drm_context * wld_drm_create_context(int fd)
 7 {
 8     struct wld_drm_context * drm;
 9@@ -102,17 +103,20 @@ struct wld_drm_context * wld_drm_create_context(int fd)
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_drm_destroy_context(struct wld_drm_context * drm)
15 {
16     drm_finalize_context(drm);
17     free(drm);
18 }
19 
20+EXPORT
21 bool wld_drm_is_dumb(struct wld_drm_context * drm)
22 {
23     return drm->interface == &dumb_drm;
24 }
25 
26+EXPORT
27 struct wld_drawable * wld_drm_create_drawable(struct wld_drm_context * drm,
28                                               uint32_t width, uint32_t height,
29                                               uint32_t format)
30@@ -120,6 +124,7 @@ struct wld_drawable * wld_drm_create_drawable(struct wld_drm_context * drm,
31     return drm->interface->create_drawable(drm->context, width, height, format);
32 }
33 
34+EXPORT
35 struct wld_drawable * wld_drm_import(struct wld_drm_context * drm,
36                                      uint32_t width, uint32_t height,
37                                      uint32_t format,
38@@ -129,6 +134,7 @@ struct wld_drawable * wld_drm_import(struct wld_drm_context * drm,
39                                   prime_fd, pitch);
40 }
41 
42+EXPORT
43 struct wld_drawable * wld_drm_import_gem(struct wld_drm_context * drm,
44                                          uint32_t width, uint32_t height,
45                                          uint32_t format,
46@@ -138,11 +144,13 @@ struct wld_drawable * wld_drm_import_gem(struct wld_drm_context * drm,
47                                       gem_name, pitch);
48 }
49 
50+EXPORT
51 int wld_drm_export(struct wld_drawable * drawable)
52 {
53     return ((struct drm_draw_interface *) drawable->interface)->export(drawable);
54 }
55 
56+EXPORT
57 uint32_t wld_drm_get_handle(struct wld_drawable * drawable)
58 {
59     return ((struct drm_draw_interface *) drawable->interface)->get_handle(drawable);
M font.c
+7, -0
 1@@ -25,6 +25,7 @@
 2 
 3 #include <fontconfig/fcfreetype.h>
 4 
 5+EXPORT
 6 struct wld_font_context * wld_font_create_context()
 7 {
 8     struct wld_font_context * context;
 9@@ -49,12 +50,14 @@ struct wld_font_context * wld_font_create_context()
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_font_destroy_context(struct wld_font_context * context)
15 {
16     FT_Done_FreeType(context->library);
17     free(context);
18 }
19 
20+EXPORT
21 struct wld_font * wld_font_open_name(struct wld_font_context * context,
22                                      const char * name)
23 {
24@@ -75,6 +78,7 @@ struct wld_font * wld_font_open_name(struct wld_font_context * context,
25     return wld_font_open_pattern(context, match);
26 }
27 
28+EXPORT
29 struct wld_font * wld_font_open_pattern(struct wld_font_context * context,
30                                         FcPattern * match)
31 {
32@@ -150,6 +154,7 @@ struct wld_font * wld_font_open_pattern(struct wld_font_context * context,
33     return NULL;
34 }
35 
36+EXPORT
37 void wld_font_close(struct wld_font * font_base)
38 {
39     struct font * font = (void *) font_base;
40@@ -192,6 +197,7 @@ bool font_ensure_glyph(struct font * font, FT_UInt glyph_index)
41     return false;
42 }
43 
44+EXPORT
45 bool wld_font_ensure_char(struct wld_font * font_base, uint32_t character)
46 {
47     struct font * font = (void *) font_base;
48@@ -202,6 +208,7 @@ bool wld_font_ensure_char(struct wld_font * font_base, uint32_t character)
49     return font_ensure_glyph(font, glyph_index);
50 }
51 
52+EXPORT
53 void wld_font_text_extents_utf8_n(struct wld_font * font_base,
54                                   const char * text, int32_t length,
55                                   struct wld_extents * extents)
+3, -0
 1@@ -74,6 +74,7 @@ const struct wld_draw_interface pixman_draw = {
 2     .destroy = &pixman_destroy
 3 };
 4 
 5+EXPORT
 6 struct wld_pixman_context * wld_pixman_create_context()
 7 {
 8     struct wld_pixman_context * context;
 9@@ -92,6 +93,7 @@ struct wld_pixman_context * wld_pixman_create_context()
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_pixman_destroy_context(struct wld_pixman_context * context)
15 {
16     pixman_glyph_cache_destroy(context->glyph_cache);
17@@ -117,6 +119,7 @@ bool pixman_initialize_drawable
18     return drawable->image != NULL;
19 }
20 
21+EXPORT
22 struct wld_drawable * wld_pixman_create_drawable
23     (struct wld_pixman_context * context, uint32_t width, uint32_t height,
24      void * data, uint32_t pitch, uint32_t format)
+5, -0
 1@@ -82,6 +82,7 @@ const static struct wl_drm_listener drm_listener = {
 2     .capabilities = &drm_capabilities
 3 };
 4 
 5+EXPORT
 6 struct wld_wayland_drm_context * wld_wayland_drm_create_context
 7     (struct wl_display * display, struct wl_event_queue * queue)
 8 {
 9@@ -161,6 +162,7 @@ struct wld_wayland_drm_context * wld_wayland_drm_create_context
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_wayland_drm_destroy_context(struct wld_wayland_drm_context * drm)
15 {
16     drm_finalize_context(&drm->context);
17@@ -172,6 +174,7 @@ void wld_wayland_drm_destroy_context(struct wld_wayland_drm_context * drm)
18     free(drm);
19 }
20 
21+EXPORT
22 bool wld_wayland_drm_has_format(struct wld_wayland_drm_context * drm,
23                                 uint32_t format)
24 {
25@@ -186,11 +189,13 @@ bool wld_wayland_drm_has_format(struct wld_wayland_drm_context * drm,
26     return false;
27 }
28 
29+EXPORT
30 int wld_wayland_drm_get_fd(struct wld_wayland_drm_context * drm)
31 {
32     return drm->authenticated ? drm->fd : -1;
33 }
34 
35+EXPORT
36 struct wld_drawable * wld_wayland_drm_create_drawable
37     (struct wld_wayland_drm_context * drm, uint32_t width, uint32_t height,
38      uint32_t format, struct wl_buffer ** buffer)
+4, -0
 1@@ -82,6 +82,7 @@ static inline uint32_t wayland_format(uint32_t format)
 2     }
 3 }
 4 
 5+EXPORT
 6 struct wld_shm_context * wld_shm_create_context(struct wl_display * display,
 7                                                 struct wl_event_queue * queue)
 8 {
 9@@ -133,6 +134,7 @@ struct wld_shm_context * wld_shm_create_context(struct wl_display * display,
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_shm_destroy_context(struct wld_shm_context * shm)
15 {
16     wld_pixman_destroy_context(shm->pixman_context);
17@@ -143,6 +145,7 @@ void wld_shm_destroy_context(struct wld_shm_context * shm)
18     free(shm);
19 }
20 
21+EXPORT
22 bool wld_shm_has_format(struct wld_shm_context * shm, uint32_t format)
23 {
24     uint32_t * supported_format;
25@@ -156,6 +159,7 @@ bool wld_shm_has_format(struct wld_shm_context * shm, uint32_t format)
26     return false;
27 }
28 
29+EXPORT
30 struct wld_drawable * wld_shm_create_drawable(struct wld_shm_context * shm,
31                                               uint32_t width, uint32_t height,
32                                               uint32_t format,
+4, -0
 1@@ -111,6 +111,7 @@ const static struct wld_wayland_interface * interfaces[] = {
 2 #endif
 3 };
 4 
 5+EXPORT
 6 struct wld_wayland_context * wld_wayland_create_context
 7     (struct wl_display * display, enum wld_wayland_interface_id id, ...)
 8 {
 9@@ -187,12 +188,14 @@ struct wld_wayland_context * wld_wayland_create_context
10     return NULL;
11 }
12 
13+EXPORT
14 void wld_wayland_destroy_context(struct wld_wayland_context * wayland)
15 {
16     wayland->interface->destroy_context(wayland->context);
17     free(wayland);
18 }
19 
20+EXPORT
21 struct wld_drawable * wld_wayland_create_drawable
22     (struct wld_wayland_context * context, struct wl_surface * surface,
23      uint32_t width, uint32_t height, uint32_t format, uint32_t damage_flags)
24@@ -244,6 +247,7 @@ struct wld_drawable * wld_wayland_create_drawable
25     return NULL;
26 }
27 
28+EXPORT
29 void wld_wayland_drawable_set_damage_tracking(struct wld_drawable * drawable,
30                                               uint32_t flags)
31 {
+2, -0
1@@ -44,6 +44,8 @@
2 #   define DEBUG(format, ...)
3 #endif
4 
5+#define EXPORT __attribute__((visibility("default")))
6+
7 struct wld_font_context
8 {
9     FT_Library library;