[Geany-Devel] Create project files from within a plugin

Lex Trotman elextr at xxxxx
Mon Feb 19 09:04:43 UTC 2018


On 19 February 2018 at 16:29, Lars Paulsen <lars_paulsen at web.de> wrote:
> Hi Matthew,
>
> thanks for the answer.
>
> Yes, I wanted to create it programmatically. But I really only meant to
> create a project file. Not open it and make it the actual project.
> But there does not seem to be such a clear separation of project GUI and
> project file.
>
> So I guess it's better to create/write my on key file. Also it might need to
> be adjusted if the contents of a standard geany project change.

A keyfile is just a text file, so you could have a literal string in
your plugin to write out (taken from a project file contents) or you
could have a template file that you just copy to your new project
location.

>
> Greetings,
> Lars
>
>
> On 18.02.2018 22:05, Matthew Brush wrote:
>>
>> On 2018-02-18 10:52 AM, Lars Paulsen wrote:
>>>
>>> Hi All,
>>>
>>> is there a API for plugins which lets a plugin create project files and
>>> fill in some values?
>>>
>>> I do NOT want to add plugin specific data to an existing project.
>>>
>>> I want to create a new project with some meaningful data (the
>>> fields/values of geany's own project data).
>>> After that I would add plugin specific data to it.
>>>
>>
>> Hi,
>>
>> There is nothing in the API for this as far as I know. You could just
>> write your own keyfile, and open that. If you wanted to open it
>> programmatically you would have to expose a function like maybe
>> `project_load_file_with_session`[0] in the plugin API.
>>
>> Regards,
>> Matthew Brush
>>
>> [0]: https://github.com/geany/geany/blob/master/src/project.c#L268
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.geany.org
>> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel


More information about the Devel mailing list