Browse Source

add missing user data when instantiating a drawing area

master
Alexandros Theodotou 3 years ago
parent
commit
d51f6e607b
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 11
      meson.build
  2. 4
      src/ztk_drawing_area.c
  3. 20
      tests/meson.build

11
meson.build

@ -56,22 +56,19 @@ deps = [ @@ -56,22 +56,19 @@ deps = [
# for drawing
dependency('cairo', version: '>=1.0.0'),
# for rendering SVGs with cairo
dependency('librsvg-2.0'),
# math functions might be implemented in libm
cc.find_library('m', required: false),
]
cdata = configuration_data ()
if os_linux
deps += dependency('x11')
cdata.set('HAVE_X11', 1)
deps += dependency('x11')
cdata.set('HAVE_X11', 1)
endif
if get_option('enable_rsvg')
deps += dependency('librsvg-2.0')
cdata.set('HAVE_RSVG', 1)
deps += dependency('librsvg-2.0')
cdata.set('HAVE_RSVG', 1)
endif
# create config.h

4
src/ztk_drawing_area.c

@ -74,5 +74,9 @@ ztk_drawing_area_new ( @@ -74,5 +74,9 @@ ztk_drawing_area_new (
draw_cb,
ztk_drawing_area_free);
/* set user data */
ZtkWidget * widget = (ZtkWidget *) self;
widget->user_data = data;
return self;
}

20
tests/meson.build

@ -30,12 +30,14 @@ e = executable ( @@ -30,12 +30,14 @@ e = executable (
)
test ('color_test', e)
e = executable (
'rsvg', 'rsvg.c',
include_directories: inc_dirs,
link_with: ztoolkit_lib,
dependencies: deps,
)
test ('rsvg_test', e,
args: join_paths(
meson.current_source_dir(), 'test.svg'))
if get_option('enable_rsvg')
e = executable (
'rsvg', 'rsvg.c',
include_directories: inc_dirs,
link_with: ztoolkit_lib,
dependencies: deps,
)
test ('rsvg_test', e,
args: join_paths(
meson.current_source_dir(), 'test.svg'))
endif

Loading…
Cancel
Save