Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the absolute path of the resources directory to libservo #2

Open
paulrouget opened this issue Sep 30, 2017 · 8 comments
Open

Pass the absolute path of the resources directory to libservo #2

paulrouget opened this issue Sep 30, 2017 · 8 comments

Comments

@paulrouget
Copy link
Owner

I need the absolute path of the resources directory, where we put the Servo resources files.

No need to pass it to init just yet, I just need to know how to get it, as a char *.

/cc @mfkl

@paulrouget
Copy link
Owner Author

fwiw, resources can be copied from here: https://github.com/servo/servo/tree/master/resources

@paulrouget
Copy link
Owner Author

That's how init is called now:

pub extern "C" fn init(
    wakeup: extern fn(),
    resources_path: *const c_char
    width: u32
    height: u32
}

@mfkl
Copy link
Collaborator

mfkl commented Sep 30, 2017

Yeah. It's already in the repo https://github.com/paulrouget/servofocus/tree/master/xamarin/resources
Found a way to include them in the shared project (referenced by all apps) as Embed Resources. Now looking into how to find the correct path on each platform.

@paulrouget
Copy link
Owner Author

I don't know if that helps, but usually we use externalDataPath / internalDataPath to access these resources on Android.

@paulrouget
Copy link
Owner Author

So yeah, it's not possible to access resources with an absolute path. So a workaround is to copy the resources to the sdcard at startup. That sucks.

For now, we can just copy the resources folder manually, but a long term solution is for Servo to not use an absolute path but a stream.

@paulrouget
Copy link
Owner Author

paulrouget commented Oct 10, 2017

I posted on dev-servo about this issue.

@mfkl
Copy link
Collaborator

mfkl commented Oct 10, 2017

Yeah I got the workaround implementation somewhere in my stash. Still want it?

@paulrouget
Copy link
Owner Author

Nope. Thanks. Let's do that manually for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants