mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
build/windows: generate a default XCF file to be copied by Windows
Attribute uap4:ShellNewFileName is meant as a template file to be copied when someone initiate the Shell "New" command (via the Explorer context menu).
This commit is contained in:
parent
4c968d9aa0
commit
085d8a02b5
4 changed files with 51 additions and 1 deletions
|
@ -82,6 +82,7 @@ if (Test-Path -Path "$icons_path")
|
|||
{
|
||||
New-Item -ItemType Directory -Path "$arch\Assets\"
|
||||
Copy-Item -Path "$icons_path\*.png" -Destination "$arch\Assets\" -Recurse
|
||||
Copy-Item -Path "$icons_path\*.xcf" -Destination "$arch\Assets\" -Recurse
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<uap:DisplayName>eXperimental Computing Facility file</uap:DisplayName>
|
||||
<uap:Logo>Assets\fileicon.png</uap:Logo>
|
||||
<uap:SupportedFileTypes>
|
||||
<uap:FileType>.xcf</uap:FileType>
|
||||
<uap:FileType uap4:ShellNewFileName="Assets\New_GIMP_Project.xcf" uap4:ShellNewDisplayName="GIMP project file">.xcf</uap:FileType>
|
||||
</uap:SupportedFileTypes>
|
||||
</uap3:FileTypeAssociation>
|
||||
</uap3:Extension>
|
||||
|
|
25
build/windows/store/Assets/gen-new-xcf.py.in
Normal file
25
build/windows/store/Assets/gen-new-xcf.py.in
Normal file
|
@ -0,0 +1,25 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
output_path = '@BUILDDIR@/New_GIMP_Project.xcf'
|
||||
default_width = 1920
|
||||
default_height = 1080
|
||||
image = Gimp.Image.new(default_width, default_height, Gimp.ImageBaseType.RGB)
|
||||
layer = Gimp.Layer.new(image, None, default_width, default_height,
|
||||
Gimp.ImageType.RGB_IMAGE, 100.0, Gimp.LayerMode.NORMAL)
|
||||
layer.fill(Gimp.FillType.WHITE)
|
||||
image.insert_layer(layer, None, 0)
|
||||
|
||||
procedure = Gimp.get_pdb().lookup_procedure("gimp-xcf-save")
|
||||
config = procedure.create_config()
|
||||
drawables = image.list_selected_drawables()
|
||||
config.set_property("image", image)
|
||||
config.set_property("num-drawables", len(drawables))
|
||||
config.set_property("drawables", Gimp.ObjectArray.new(Gimp.Drawable, drawables, False))
|
||||
config.set_property("file", Gio.file_new_for_path(output_path))
|
||||
Gimp.Procedure.run(procedure, config)
|
||||
|
||||
v = Gimp.Procedure.run(procedure, config)
|
||||
|
||||
if v.index(0) != Gimp.PDBStatusType.SUCCESS:
|
||||
sys.exit(os.EX_SOFTWARE)
|
|
@ -248,3 +248,27 @@ foreach scale : scales
|
|||
build_by_default: true,
|
||||
env: gimp_run_env)
|
||||
endforeach
|
||||
|
||||
|
||||
# OTHER ASSETS
|
||||
|
||||
## Generate default XCF file (uap4:ShellNewFileName)
|
||||
gen_new_xcf_conf = configuration_data()
|
||||
gen_new_xcf_conf.set('BUILDDIR', meson.current_build_dir())
|
||||
gen_new_xcf_py = configure_file(
|
||||
input : 'gen-new-xcf.py.in',
|
||||
output : 'gen-new-xcf.py',
|
||||
configuration : gen_new_xcf_conf
|
||||
)
|
||||
|
||||
xcf_file = custom_target('New_GIMP_Project.xcf',
|
||||
input : [ gen_new_xcf_py ],
|
||||
depend_files: [ wilber_path ],
|
||||
output: [ 'New_GIMP_Project.xcf', ],
|
||||
command: [ gimp_exe, '-nidfs',
|
||||
'--batch-interpreter', 'python-fu-eval',
|
||||
'-b', '-', '--quit'],
|
||||
feed: true,
|
||||
build_by_default: true,
|
||||
env: gimp_run_env
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue