mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-18 11:42:47 +00:00
More scripts removed. Better file-selector
This commit is contained in:
parent
1c3cba7208
commit
3932753b38
@ -121,6 +121,7 @@ THANKFULNESS
|
|||||||
<http://www.lua.org/>
|
<http://www.lua.org/>
|
||||||
|
|
||||||
And thanks for all the ideas and bugs report of:
|
And thanks for all the ideas and bugs report of:
|
||||||
|
Alex Winter
|
||||||
Álvaro González (Kronoman X)
|
Álvaro González (Kronoman X)
|
||||||
Angelo Mottola
|
Angelo Mottola
|
||||||
Ben Davis (entheh)
|
Ben Davis (entheh)
|
||||||
@ -137,5 +138,6 @@ THANKFULNESS
|
|||||||
Manuel Quiñones (manuq)
|
Manuel Quiñones (manuq)
|
||||||
Mateusz Czaplinski
|
Mateusz Czaplinski
|
||||||
Nathan Smith (whitedoor)
|
Nathan Smith (whitedoor)
|
||||||
|
Nora Amendez
|
||||||
Peter Wang (tjaden)
|
Peter Wang (tjaden)
|
||||||
Robert J Ohannessian (Bob)
|
Robert J Ohannessian (Bob)
|
||||||
|
4
NEWS.txt
4
NEWS.txt
@ -5,10 +5,10 @@ NEWS
|
|||||||
0.6
|
0.6
|
||||||
---
|
---
|
||||||
|
|
||||||
|
+ Better file selector.
|
||||||
+ Restructured all the menus (more user friendly options).
|
+ Restructured all the menus (more user friendly options).
|
||||||
- Temporaly removed a lot of complex functionality:
|
- Temporaly removed a lot of complex functionality:
|
||||||
Mask-Repository (but you can use .msk files yet), Draw-Text,
|
Mask-Repository (but you can use .msk files yet), Draw-Text.
|
||||||
Play-FLI/FLC.
|
|
||||||
+ New XML format for the menus.
|
+ New XML format for the menus.
|
||||||
- Removed menu scripting customization.
|
- Removed menu scripting customization.
|
||||||
- Removed screen saver.
|
- Removed screen saver.
|
||||||
|
@ -192,11 +192,13 @@
|
|||||||
<item command="despeckle" name="&Despeckle (median filter)" />
|
<item command="despeckle" name="&Despeckle (median filter)" />
|
||||||
</menu>
|
</menu>
|
||||||
<!-- <item command="draw_text" name="Draw &Text" /> -->
|
<!-- <item command="draw_text" name="Draw &Text" /> -->
|
||||||
<!-- <item command="play_flic" name="Pla&y FLI/FLC File" /> -->
|
|
||||||
<!-- <item command="mapgen" name="&MapGen" /> -->
|
<!-- <item command="mapgen" name="&MapGen" /> -->
|
||||||
<menu name="Scripting">
|
<menu name="Scripting">
|
||||||
<item command="run_script" name="Run &Script" />
|
<item command="run_script" name="Run &Script" />
|
||||||
</menu>
|
</menu>
|
||||||
|
<menu name="Extras">
|
||||||
|
<item command="play_flic" name="Pla&y FLI/FLC File" />
|
||||||
|
</menu>
|
||||||
<separator />
|
<separator />
|
||||||
<item command="tips" name="T&ips" />
|
<item command="tips" name="T&ips" />
|
||||||
<item command="options" name="&Options" />
|
<item command="options" name="&Options" />
|
||||||
|
@ -50,6 +50,5 @@
|
|||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
<button text=_("&Close") />
|
|
||||||
</box>
|
</box>
|
||||||
</window>
|
</window>
|
||||||
|
272
data/menus.en
272
data/menus.en
@ -1,272 +0,0 @@
|
|||||||
# allegro-sprite-editor menus -*- Shell-script -*-
|
|
||||||
# Copyright (C) 2001-2005, 2007 by David A. Capello
|
|
||||||
#
|
|
||||||
# Loader in "src/modules/rootmenu.c"
|
|
||||||
# Check methods in "src/modules/chkmthds.c"
|
|
||||||
#
|
|
||||||
# See "src/script/bindings.src" for the list of available script routines
|
|
||||||
#
|
|
||||||
# Format:
|
|
||||||
# -------
|
|
||||||
#
|
|
||||||
# # <- comment
|
|
||||||
# sub-menu {
|
|
||||||
# menu-item = check_method script_expression [keyboard_bindings...] ;
|
|
||||||
# sprite-list-menu SPRITE_LIST ;
|
|
||||||
# recent-list-menu RECENT_LIST ;
|
|
||||||
# ----
|
|
||||||
# layer-menu LAYER_POPUP {
|
|
||||||
# ...
|
|
||||||
# }
|
|
||||||
# frame-menu FRAME_POPUP {
|
|
||||||
# ...
|
|
||||||
# }
|
|
||||||
# undo-action UNDO_ACCEL = ... ;
|
|
||||||
# redo-action REDO_ACCEL = ... ;
|
|
||||||
# open-film-editor-action FILMEDITOR_ACCEL = ... ;
|
|
||||||
# screenshot-action SCREENSHOT_ACCEL = ... ;
|
|
||||||
# ...
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# References:
|
|
||||||
# -----------
|
|
||||||
#
|
|
||||||
# script_expression:
|
|
||||||
# The script string to be run.
|
|
||||||
#
|
|
||||||
# keyboard_bindings:
|
|
||||||
# Keys shorcuts for the menu (must be between <...>).
|
|
||||||
# The characters between <...> can not have spaces.
|
|
||||||
# The first key shortcut will be showed in the program.
|
|
||||||
#
|
|
||||||
# ----:
|
|
||||||
# Is a separator
|
|
||||||
#
|
|
||||||
# check_method:
|
|
||||||
# A name of a method to check when this options should be available
|
|
||||||
# on interactive mode:
|
|
||||||
#
|
|
||||||
# always - always is enabled
|
|
||||||
# has_sprite - only when we are editing a sprite
|
|
||||||
# has_layer - only when we are editing a layer
|
|
||||||
# has_layerimage - only when we are editing a layer (of "image" type)
|
|
||||||
# has_image - only when we are editing a image
|
|
||||||
# can_undo - only when we can undo
|
|
||||||
# can_redo - only when we can redo
|
|
||||||
# has_path - sprite has a working path
|
|
||||||
# has_mask - sprite has a region marked
|
|
||||||
# has_imagemask - sprite has a region marked in a image layer
|
|
||||||
# has_clipboard - only when the clipboard can be used in
|
|
||||||
# the current sprite
|
|
||||||
#
|
|
||||||
# menu_bar - menu bar visibility
|
|
||||||
# status_bar - status bar visibility
|
|
||||||
# color_bar - color bar visibility
|
|
||||||
# tool_bar - tool bar visibility
|
|
||||||
#
|
|
||||||
# tool_marker - current tool is marker?
|
|
||||||
# tool_dots - current tool is dots?
|
|
||||||
# tool_pencil - current tool is pencil?
|
|
||||||
# tool_brush - current tool is brush?
|
|
||||||
# tool_floodfill - current tool is floodfill?
|
|
||||||
# tool_spray - current tool is spray?
|
|
||||||
# tool_line - current tool is line?
|
|
||||||
# tool_rectangle - current tool is rectangle?
|
|
||||||
# tool_ellipse - current tool is ellipse?
|
|
||||||
#
|
|
||||||
# is_rec - controls the check status if is recording-screen on/off
|
|
||||||
# is_movingframe - when the user moves a frame in the film editor
|
|
||||||
#
|
|
||||||
|
|
||||||
- {
|
|
||||||
"&Tips" = always "dialogs_tips(true)" <F1> ;
|
|
||||||
"&About" = always "dialogs_about()" ;
|
|
||||||
"&Refresh" = always "app_refresh_screen()" <F5> ;
|
|
||||||
----
|
|
||||||
"&Screen Saver" = always "dialogs_screen_saver()" ;
|
|
||||||
"Set &Graphics Mode" {
|
|
||||||
"&Select" = always "set_gfx(\"interactive\", 0, 0, 0)" ;
|
|
||||||
----
|
|
||||||
"320x200 8" = always "set_gfx(\"autodetect\", 320, 200, 8)" ;
|
|
||||||
"320x240 8" = always "set_gfx(\"autodetect\", 320, 240, 8)" ;
|
|
||||||
"640x480 8" = always "set_gfx(\"autodetect\", 640, 480, 8)" ;
|
|
||||||
"800x600 8" = always "set_gfx(\"autodetect\", 800, 600, 8)" ;
|
|
||||||
----
|
|
||||||
"320x200 16" = always "set_gfx(\"autodetect\", 320, 200, 16)" ;
|
|
||||||
"320x240 16" = always "set_gfx(\"autodetect\", 320, 240, 16)" ;
|
|
||||||
"640x480 16" = always "set_gfx(\"autodetect\", 640, 480, 16)" ;
|
|
||||||
"800x600 16" = always "set_gfx(\"autodetect\", 800, 600, 16)" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Screen Sh&ot" SCREENSHOT_ACCEL = always "screen_shot()" <F12> ;
|
|
||||||
"Recording Screen" = is_rec "switch_recording_screen()" ;
|
|
||||||
----
|
|
||||||
"Reload &Menus" = always "rebuild_root_menu_with_alert()" ;
|
|
||||||
----
|
|
||||||
"Load Session" = always "GUI_LoadSession()" ;
|
|
||||||
"Save Session" = always "GUI_SaveSession()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&File {
|
|
||||||
"&New" = always "GUI_NewSprite()" <Ctrl+N> ;
|
|
||||||
"&Open" = always "GUI_OpenSprite()" <Ctrl+O> <F3> ;
|
|
||||||
"Open &Recent" RECENT_LIST ;
|
|
||||||
----
|
|
||||||
"&Save" = has_sprite "GUI_SaveSprite()" <Ctrl+S> <F2> ;
|
|
||||||
"&Close" = has_sprite "GUI_CloseSprite()" <Ctrl+W> ;
|
|
||||||
----
|
|
||||||
"E&xit" = always "GUI_Exit()" <Ctrl+Q> <Esc> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Edit {
|
|
||||||
"&Undo" UNDO_ACCEL = can_undo "GUI_Undo()" <Ctrl+Z> <Ctrl+U> ;
|
|
||||||
"&Redo" REDO_ACCEL = can_redo "GUI_Redo()" <Ctrl+R> ;
|
|
||||||
----
|
|
||||||
"Cu&t" = has_imagemask "cut_to_clipboard()" <Ctrl+X> <Shift+Del> ;
|
|
||||||
"&Copy" = has_imagemask "copy_to_clipboard()" <Ctrl+C> <Ctrl+Ins> ;
|
|
||||||
"&Paste" = has_clipboard "paste_from_clipboard(true, 0, 0, 0, 0)" <Ctrl+V> <Shift+Ins> ;
|
|
||||||
"C&lear" = has_image "GUI_EditClear()" <Ctrl+B> <Ctrl+Del> ;
|
|
||||||
----
|
|
||||||
"Quick &Move" = has_imagemask "quick_move()" <Shift+M> ;
|
|
||||||
"Quick C&opy" = has_imagemask "quick_copy()" <Shift+C> ;
|
|
||||||
# "Quick S&wap" = has_imagemask "quick_swap()" <Shift+S> ;
|
|
||||||
----
|
|
||||||
"Flip &Horizontal" = has_image "GUI_FlipHorizontal()" <Shift+H> ;
|
|
||||||
"Flip &Vertical" = has_image "GUI_FlipVertical()" <Shift+V> ;
|
|
||||||
----
|
|
||||||
"R&eplace Color" = has_image "dialogs_replace_color()" </> ;
|
|
||||||
"&Invert" = has_image "dialogs_invert_color()" <Ctrl+I> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Sprite {
|
|
||||||
"&Properties" = has_sprite "GUI_SpriteProperties()" <Ctrl+P> ;
|
|
||||||
----
|
|
||||||
"&Duplicate" = has_sprite "GUI_DuplicateSprite()" ;
|
|
||||||
"Image &Type" = has_sprite "GUI_ImageType()" ;
|
|
||||||
----
|
|
||||||
#"&Image Resize" = has_sprite "print(\"Unavailable\")" ;
|
|
||||||
#"&Canvas Resize" = has_sprite "canvas_resize()" ;
|
|
||||||
"Cr&op" = has_mask "crop_sprite()" ;
|
|
||||||
"&Auto Crop" = has_sprite "autocrop_sprite()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Layer LAYER_POPUP {
|
|
||||||
"&Properties" = has_layer "GUI_LayerProperties()" <Shift+P> ;
|
|
||||||
----
|
|
||||||
"&New" = has_sprite "GUI_NewLayer()" <Shift+N> ;
|
|
||||||
"New &Set" = has_sprite "GUI_NewLayerSet()" ;
|
|
||||||
"&Remove" = has_layer "GUI_RemoveLayer()" ;
|
|
||||||
----
|
|
||||||
"&Duplicate" = has_layer "GUI_DuplicateLayer()" ;
|
|
||||||
"&Merge Down" = has_layer "GUI_MergeDown()" ;
|
|
||||||
"&Flatten" = has_layer "FlattenLayers()" ;
|
|
||||||
"Cr&op" = has_mask "crop_layer()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
F&rame FRAME_POPUP {
|
|
||||||
"&Properties" = has_image "GUI_FrameProperties()" <Ctrl+Shift+P> ;
|
|
||||||
"&Remove" = has_image "GUI_RemoveFrame()" ;
|
|
||||||
----
|
|
||||||
"&New" = has_layerimage "new_frame()" <Ctrl+Shift+N> ;
|
|
||||||
"&Move" = is_movingframe "move_frame()" ;
|
|
||||||
"&Copy" = is_movingframe "copy_frame()" ;
|
|
||||||
"&Link" = is_movingframe "link_frame()" ;
|
|
||||||
----
|
|
||||||
"Cr&op" = has_imagemask "crop_frame()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Mask {
|
|
||||||
"&All" = has_sprite "MaskAll()" <Ctrl+A> ;
|
|
||||||
"&Deselect" = has_mask "DeselectMask()" <Ctrl+D> ;
|
|
||||||
"&Reselect" = has_sprite "ReselectMask()" <Shift+Ctrl+D> ;
|
|
||||||
"&Invert" = has_sprite "InvertMask()" <Shift+Ctrl+I> ;
|
|
||||||
# "&Shrink" = has_imagemask "selection(current_sprite, SEL_SHRINK)" ;
|
|
||||||
----
|
|
||||||
"&Color" = has_image "dialogs_mask_color()" <?> ;
|
|
||||||
"S&pecial" {
|
|
||||||
"Stretch &Bottom" = has_mask "StretchMaskBottom()" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Repositor&y" = has_sprite "dialogs_mask_repository()" <Shift+Ctrl+M> ;
|
|
||||||
"&Load" = has_sprite "GUI_LoadMask()" ;
|
|
||||||
"&Save" = has_mask "GUI_SaveMask()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
# XXX
|
|
||||||
# &Path {
|
|
||||||
# "&Repository" = has_sprite "print(\"Unavailable\")" <Shift+Ctrl+P> ;
|
|
||||||
# "&Load" = has_sprite "print(\"Unavailable\")" ;
|
|
||||||
# "&Save" = has_path "print(\"Unavailable\")" ;
|
|
||||||
# }
|
|
||||||
|
|
||||||
&Tool {
|
|
||||||
"&Drawing Tool" {
|
|
||||||
"&Configure" = always "dialogs_tools_configuration()" <C> ;
|
|
||||||
----
|
|
||||||
"&Marker" = tool_marker "select_tool(\"Marker\")" <M> ;
|
|
||||||
"&Dots" = tool_dots "select_tool(\"Dots\")" <D> ;
|
|
||||||
"&Pencil" = tool_pencil "select_tool(\"Pencil\")" <P> ;
|
|
||||||
"&Brush (real pencil)" = tool_brush "select_tool(\"Brush\")" <B> ;
|
|
||||||
"&Floodfill" = tool_floodfill "select_tool(\"Floodfill\")" <F> ;
|
|
||||||
"&Spray" = tool_spray "select_tool(\"Spray\")" <S> ;
|
|
||||||
"&Line" = tool_line "select_tool(\"Line\")" <L> ;
|
|
||||||
"&Rectangle" = tool_rectangle "select_tool(\"Rectangle\")" <R> ;
|
|
||||||
"&Ellipse" = tool_ellipse "select_tool(\"Ellipse\")" <E> ;
|
|
||||||
# "&Oval" = tool_path "select_tool(\"Oval\")" <O> ;
|
|
||||||
}
|
|
||||||
&Filters FILTERS_POPUP {
|
|
||||||
"Convolution &Matrix" = has_image "dialogs_convolution_matrix()" <F9> ;
|
|
||||||
"&Color Curve" = has_image "dialogs_color_curve()" <Ctrl+M> <F10> ;
|
|
||||||
#"&Gaussian Blur" = has_image "gaussian_blur(current_sprite)" ;
|
|
||||||
#"&Vector Map" = has_image "dialogs_vector_map()" ;
|
|
||||||
----
|
|
||||||
"&Despeckle (median filter)" = has_image "dialogs_median_filter()" ;
|
|
||||||
}
|
|
||||||
# "Make &Undo Animation" = has_sprite
|
|
||||||
# "sprite = make_undo_animation(current_sprite)
|
|
||||||
# if sprite ~= nil then select_sprite(sprite) end" ;
|
|
||||||
&Scripts {
|
|
||||||
"Load script &file" = always "GUI_LoadScriptFile()" <Ctrl+0> ;
|
|
||||||
----
|
|
||||||
"aselogo.lua" = always "include(\"examples/aselogo.lua\")" ;
|
|
||||||
"cosy.lua" = always "include(\"examples/cosy.lua\")" ;
|
|
||||||
"dacap.lua" = always "include(\"examples/dacap.lua\")" ;
|
|
||||||
"shell.lua" = always "include(\"examples/shell.lua\")" ;
|
|
||||||
"spiral.lua" = always "include(\"examples/spiral.lua\")" ;
|
|
||||||
"terrain.lua" = always "include(\"examples/terrain.lua\")" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Draw &Text" = has_sprite "dialogs_draw_text()" ;
|
|
||||||
"&MapGen" = always "dialogs_mapgen()" ;
|
|
||||||
"&Play FLI/FLC File" = always "GUI_PlayFLI()" ;
|
|
||||||
# ----
|
|
||||||
# "Test &JID File" = always "GUI_TestJID()" ;
|
|
||||||
----
|
|
||||||
"&Options" = always "dialogs_options()" <Shift+Ctrl+O> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&View {
|
|
||||||
"&Tiled" = has_sprite "view_tiled()" <F8> ;
|
|
||||||
"&Normal" = has_sprite "view_normal()" <F7> ;
|
|
||||||
"&Fullscreen" = has_sprite "view_fullscreen()" ;
|
|
||||||
----
|
|
||||||
"&Menu Bar" = menu_bar "app_switch(app_get_menu_bar())" <Ctrl+F1> ;
|
|
||||||
"&Status Bar" = status_bar "app_switch(app_get_status_bar())" <Ctrl+F2> ;
|
|
||||||
"&Color Bar" = color_bar "app_switch(app_get_color_bar())" <Ctrl+F3> ;
|
|
||||||
"T&ool Bar" = tool_bar "app_switch(app_get_tool_bar())" <Ctrl+F4> ;
|
|
||||||
----
|
|
||||||
&Editor {
|
|
||||||
"Make &Unique" = always "make_unique_editor(current_editor)" <Ctrl+1> ;
|
|
||||||
----
|
|
||||||
"Split &Vertically" = always "split_editor(current_editor, JI_VERTICAL)" <Ctrl+2> ;
|
|
||||||
"Split &Horizontally" = always "split_editor(current_editor, JI_HORIZONTAL)" <Ctrl+3> ;
|
|
||||||
----
|
|
||||||
"&Close" = always "close_editor(current_editor)" <Ctrl+4> ;
|
|
||||||
}
|
|
||||||
"Fi&lm Editor" FILMEDITOR_ACCEL = has_sprite "switch_between_film_and_sprite_editor()" <Tab> ;
|
|
||||||
"&Palette Editor" = always "dialogs_palette_editor()" <F4> ;
|
|
||||||
----
|
|
||||||
"F&ilters Popup Menu" = always "show_fx_popup_menu()" <X> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
L&ist SPRITE_LIST ;
|
|
189
data/menus.es
189
data/menus.es
@ -1,189 +0,0 @@
|
|||||||
# allegro-sprite-editor menus -*- Shell-script -*-
|
|
||||||
# Copyright (C) 2001-2005, 2007 by David A. Capello
|
|
||||||
#
|
|
||||||
# Spanish menus (see menus.en for more information)
|
|
||||||
|
|
||||||
- {
|
|
||||||
"&Tips" = always "dialogs_tips(true)" <F1> ;
|
|
||||||
"&Acerca de" = always "dialogs_about()" ;
|
|
||||||
"&Refrescar" = always "app_refresh_screen()" <F5> ;
|
|
||||||
----
|
|
||||||
"&Protector de Pantalla" = always "dialogs_screen_saver()" ;
|
|
||||||
"Cambiar Modo &Gráfico" {
|
|
||||||
"&Seleccionar" = always "set_gfx(\"interactive\", 0, 0, 0)" ;
|
|
||||||
----
|
|
||||||
"320x200 8" = always "set_gfx(\"autodetect\", 320, 200, 8)" ;
|
|
||||||
"320x240 8" = always "set_gfx(\"autodetect\", 320, 240, 8)" ;
|
|
||||||
"640x480 8" = always "set_gfx(\"autodetect\", 640, 480, 8)" ;
|
|
||||||
"800x600 8" = always "set_gfx(\"autodetect\", 800, 600, 8)" ;
|
|
||||||
----
|
|
||||||
"320x200 16" = always "set_gfx(\"autodetect\", 320, 200, 16)" ;
|
|
||||||
"320x240 16" = always "set_gfx(\"autodetect\", 320, 240, 16)" ;
|
|
||||||
"640x480 16" = always "set_gfx(\"autodetect\", 640, 480, 16)" ;
|
|
||||||
"800x600 16" = always "set_gfx(\"autodetect\", 800, 600, 16)" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Screen Sh&ot" SCREENSHOT_ACCEL = always "screen_shot()" <F12> ;
|
|
||||||
"G&rabar Pantalla" = is_rec "switch_recording_screen()" ;
|
|
||||||
----
|
|
||||||
"Recargar los &Menus" = always "rebuild_root_menu_with_alert()" ;
|
|
||||||
----
|
|
||||||
"Cargar Sesión" = always "GUI_LoadSession()" ;
|
|
||||||
"Guardar Sesión" = always "GUI_SaveSession()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Archivo {
|
|
||||||
"&Nuevo" = always "GUI_NewSprite()" <Ctrl+N> ;
|
|
||||||
"&Abrir" = always "GUI_OpenSprite()" <Ctrl+O> <F3> ;
|
|
||||||
"Abrir &Reciente" RECENT_LIST ;
|
|
||||||
----
|
|
||||||
"&Guardar" = has_sprite "GUI_SaveSprite()" <Ctrl+S> <F2> ;
|
|
||||||
"&Cerrar" = has_sprite "GUI_CloseSprite()" <Ctrl+W> ;
|
|
||||||
----
|
|
||||||
"&Salir" = always "GUI_Exit()" <Ctrl+Q> <Esc> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Edit {
|
|
||||||
"&Deshacer" UNDO_ACCEL = can_undo "GUI_Undo()" <Ctrl+Z> <Ctrl+U> ;
|
|
||||||
"&Rehacer" REDO_ACCEL = can_redo "GUI_Redo()" <Ctrl+R> ;
|
|
||||||
----
|
|
||||||
"Cortar" = has_imagemask "cut_to_clipboard()" <Ctrl+X> <Shift+Del> ;
|
|
||||||
"Copiar" = has_imagemask "copy_to_clipboard()" <Ctrl+C> <Ctrl+Ins> ;
|
|
||||||
"Pegar" = has_clipboard "paste_from_clipboard(true, 0, 0, 0, 0)" <Ctrl+V> <Shift+Ins> ;
|
|
||||||
"Borrar" = has_image "GUI_EditClear()" <Ctrl+B> <Ctrl+Del> ;
|
|
||||||
----
|
|
||||||
"Movimiento Rápido" = has_imagemask "quick_move()" <Shift+M> ;
|
|
||||||
"Copia Rápida" = has_imagemask "quick_copy()" <Shift+C> ;
|
|
||||||
# "Intercambio Rápido" = has_imagemask "quick_swap()" <Shift+S> ;
|
|
||||||
----
|
|
||||||
"Flip &Horizontal" = has_image "GUI_FlipHorizontal()" <Shift+H> ;
|
|
||||||
"Flip &Vertical" = has_image "GUI_FlipVertical()" <Shift+V> ;
|
|
||||||
----
|
|
||||||
"Reemplazar Color" = has_image "dialogs_replace_color()" </> ;
|
|
||||||
"Invertir" = has_image "dialogs_invert_color()" <Ctrl+I> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Sprite {
|
|
||||||
"&Propiedades" = has_sprite "GUI_SpriteProperties()" <Ctrl+P> ;
|
|
||||||
----
|
|
||||||
"&Duplicar" = has_sprite "GUI_DuplicateSprite()" ;
|
|
||||||
"&Tipo de Imagen" = has_sprite "GUI_ImageType()" ;
|
|
||||||
----
|
|
||||||
#"Tamaño de &Imagen" = has_sprite "print(\"Unavailable\")" ;
|
|
||||||
#"&Canvas Resize" = has_sprite "canvas_resize()" ;
|
|
||||||
"Rec&ortar" = has_mask "crop_sprite()" ;
|
|
||||||
"Recortar &Automáticamente" = has_sprite "autocrop_sprite()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Layer LAYER_POPUP {
|
|
||||||
"&Propiedades" = has_layer "GUI_LayerProperties()" <Shift+P> ;
|
|
||||||
----
|
|
||||||
"&Nueva Capa" = has_sprite "GUI_NewLayer()" <Shift+N> ;
|
|
||||||
"Nuevo Con&junto" = has_sprite "GUI_NewLayerSet()" ;
|
|
||||||
"&Remover" = has_layer "GUI_RemoveLayer()" ;
|
|
||||||
----
|
|
||||||
"&Duplicar" = has_layer "GUI_DuplicateLayer()" ;
|
|
||||||
"&Mezclar Abajo" = has_layer "GUI_MergeDown()" ;
|
|
||||||
"&Aplanar" = has_layer "FlattenLayers()" ;
|
|
||||||
"Rec&ortar" = has_mask "crop_layer()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
F&rame FRAME_POPUP {
|
|
||||||
"&Propiedades" = has_layer "GUI_FrameProperties()" <Ctrl+Shift+P> ;
|
|
||||||
"&Remover" = has_image "GUI_RemoveFrame()" ;
|
|
||||||
----
|
|
||||||
"&Nuevo" = has_layerimage "new_frame()" <Ctrl+Shift+N> ;
|
|
||||||
"&Mover" = is_movingframe "move_frame()" ;
|
|
||||||
"&Copiar" = is_movingframe "copy_frame()" ;
|
|
||||||
"En&lazar" = is_movingframe "link_frame()" ;
|
|
||||||
----
|
|
||||||
"Rec&ortar" = has_imagemask "crop_frame()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Mask {
|
|
||||||
"&Todo" = has_sprite "MaskAll()" <Ctrl+A> ;
|
|
||||||
"&Deseleccionar" = has_mask "DeselectMask()" <Ctrl+D> ;
|
|
||||||
"&Reseleccionar" = has_sprite "ReselectMask()" <Shift+Ctrl+D> ;
|
|
||||||
"&Invertir" = has_sprite "InvertMask()" <Shift+Ctrl+I> ;
|
|
||||||
----
|
|
||||||
"&Color" = has_image "dialogs_mask_color()" <?> ;
|
|
||||||
"&Especial" {
|
|
||||||
"Estirar &Fondo" = has_mask "StretchMaskBottom()" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Repositorio" = has_sprite "dialogs_mask_repository()" <Shift+Ctrl+M> ;
|
|
||||||
"Cargar" = has_sprite "GUI_LoadMask()" ;
|
|
||||||
"Guardar" = has_mask "GUI_SaveMask()" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
# XXX
|
|
||||||
# &Path {
|
|
||||||
# "Repositorio" = has_sprite "print(\"Unavailable\")" <Shift+Ctrl+P> ;
|
|
||||||
# "Cargar" = has_sprite "print(\"Unavailable\")" ;
|
|
||||||
# "Guardar" = has_path "print(\"Unavailable\")" ;
|
|
||||||
# }
|
|
||||||
|
|
||||||
&Tool {
|
|
||||||
"&Herramientas de Dibujo" {
|
|
||||||
"&Configurar" = always "dialogs_tools_configuration()" <C> ;
|
|
||||||
----
|
|
||||||
"&Marcador" = tool_marker "select_tool(\"Marker\")" <M> ;
|
|
||||||
"Puntos" = tool_dots "select_tool(\"Dots\")" <D> ;
|
|
||||||
"Pincel" = tool_pencil "select_tool(\"Pencil\")" <P> ;
|
|
||||||
"&Brocha (pincel real)" = tool_brush "select_tool(\"Brush\")" <B> ;
|
|
||||||
"Relleno" = tool_floodfill "select_tool(\"Floodfill\")" <F> ;
|
|
||||||
"&Spray" = tool_spray "select_tool(\"Spray\")" <S> ;
|
|
||||||
"&Línea" = tool_line "select_tool(\"Line\")" <L> ;
|
|
||||||
"&Rectángulo" = tool_rectangle "select_tool(\"Rectangle\")" <R> ;
|
|
||||||
"&Elipse" = tool_ellipse "select_tool(\"Ellipse\")" <E> ;
|
|
||||||
}
|
|
||||||
&Filtros FILTERS_POPUP {
|
|
||||||
"&Matriz de Convolución" = has_image "dialogs_convolution_matrix()" <F9> ;
|
|
||||||
"&Curva de Color" = has_image "dialogs_color_curve()" <Ctrl+M> <F10> ;
|
|
||||||
# "Mapa de &Vectores" = has_image "dialogs_vector_map()" <F11> ;
|
|
||||||
----
|
|
||||||
"&Reducción de ruido (filtrado por mediana)" = has_image "dialogs_median_filter()" ;
|
|
||||||
}
|
|
||||||
&Scripts {
|
|
||||||
"Cargar script desde &archivo" = always "GUI_LoadScriptFile()" <Ctrl+0> ;
|
|
||||||
----
|
|
||||||
"aselogo.lua" = always "include(\"examples/aselogo.lua\")" ;
|
|
||||||
"cosy.lua" = always "include(\"examples/cosy.lua\")" ;
|
|
||||||
"dacap.lua" = always "include(\"examples/dacap.lua\")" ;
|
|
||||||
"shell.lua" = always "include(\"examples/shell.lua\")" ;
|
|
||||||
"spiral.lua" = always "include(\"examples/spiral.lua\")" ;
|
|
||||||
"terrain.lua" = always "include(\"examples/terrain.lua\")" ;
|
|
||||||
}
|
|
||||||
----
|
|
||||||
"Dibujar &Texto" = has_sprite "dialogs_draw_text()" ;
|
|
||||||
"&MapGen" = always "dialogs_mapgen()" ;
|
|
||||||
"&Reproducir Archivo FLI/FLC" = always "GUI_PlayFLI()" ;
|
|
||||||
----
|
|
||||||
"&Opciones" = always "dialogs_options()" <Shift+Ctrl+O> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
&Ver {
|
|
||||||
"&Alicatado" = has_sprite "view_tiled()" <F8> ;
|
|
||||||
"&Normal" = has_sprite "view_normal()" <F7> ;
|
|
||||||
"Pantalla c&ompleta" = has_sprite "view_fullscreen()" ;
|
|
||||||
----
|
|
||||||
"Barra de &Menu" = menu_bar "app_switch(app_get_menu_bar())" <Ctrl+F1> ;
|
|
||||||
"Barra de E&stado" = status_bar "app_switch(app_get_status_bar())" <Ctrl+F2> ;
|
|
||||||
"Barra de &Colores" = color_bar "app_switch(app_get_color_bar())" <Ctrl+F3> ;
|
|
||||||
"Barra de &Herramientas" = tool_bar "app_switch(app_get_tool_bar())" <Ctrl+F4> ;
|
|
||||||
----
|
|
||||||
&Editor {
|
|
||||||
"Hacer &Único" = always "make_unique_editor(current_editor)" <Ctrl+1> ;
|
|
||||||
----
|
|
||||||
"Dividir &Verticalmente" = always "split_editor(current_editor, JI_VERTICAL)" <Ctrl+2> ;
|
|
||||||
"Dividir &Horizontalmente" = always "split_editor(current_editor, JI_HORIZONTAL)" <Ctrl+3> ;
|
|
||||||
----
|
|
||||||
"&Cerrar" = always "close_editor(current_editor)" <Ctrl+4> ;
|
|
||||||
}
|
|
||||||
"E&ditor de Película" FILMEDITOR_ACCEL = has_sprite "switch_between_film_and_sprite_editor()" <Tab> ;
|
|
||||||
"&Paleta de Colores" = always "dialogs_palette_editor()" <F4> ;
|
|
||||||
----
|
|
||||||
"Popup Menu de &Filtros" = always "show_fx_popup_menu()" <X> ;
|
|
||||||
}
|
|
||||||
|
|
||||||
L&ista SPRITE_LIST ;
|
|
@ -1,71 +0,0 @@
|
|||||||
-- ase -- allegro-sprite-editor: the ultimate sprites factory
|
|
||||||
-- Copyright (C) 2001-2005 by David A. Capello
|
|
||||||
|
|
||||||
-- shows the JPEG configuration dialog
|
|
||||||
function ConfigureJPEG()
|
|
||||||
-- configuration parameters
|
|
||||||
local quality = get_config_int("JPEG", "Quality", 100)
|
|
||||||
local smooth = get_config_int("JPEG", "Smooth", 0)
|
|
||||||
local method = get_config_int("JPEG", "Method", 0)
|
|
||||||
-- widgets
|
|
||||||
local window = jwindow_new(_("Configure JPEG Compression"))
|
|
||||||
local box1 = jbox_new(JI_VERTICAL)
|
|
||||||
local box2 = jbox_new(JI_HORIZONTAL)
|
|
||||||
local box3 = jbox_new(JI_VERTICAL + JI_HOMOGENEOUS)
|
|
||||||
local box4 = jbox_new(JI_VERTICAL + JI_HOMOGENEOUS)
|
|
||||||
local box5 = jbox_new(JI_HORIZONTAL + JI_HOMOGENEOUS)
|
|
||||||
local label_quality = jlabel_new(_("Quality:"), JI_LEFT)
|
|
||||||
local label_smooth = jlabel_new(_("Smooth:"), JI_LEFT)
|
|
||||||
local label_method = jlabel_new(_("Method:"), JI_LEFT)
|
|
||||||
local slider_quality = jslider_new(0, 100, quality)
|
|
||||||
local slider_smooth = jslider_new(0, 100, smooth)
|
|
||||||
local view_method = jview_new()
|
|
||||||
local list_method = jlistbox_new()
|
|
||||||
local button_ok = jbutton_new(_("&OK"))
|
|
||||||
local button_cancel = jbutton_new(_("&Cancel"))
|
|
||||||
local ret
|
|
||||||
|
|
||||||
jwidget_add_child (list_method, jlistitem_new(_("Slow")))
|
|
||||||
jwidget_add_child (list_method, jlistitem_new(_("Fast")))
|
|
||||||
jwidget_add_child (list_method, jlistitem_new(_("Float")))
|
|
||||||
jlistbox_select_index(list_method, method)
|
|
||||||
|
|
||||||
jview_attach(view_method, list_method)
|
|
||||||
jview_maxsize(view_method)
|
|
||||||
|
|
||||||
jwidget_expansive(box4, true)
|
|
||||||
jwidget_expansive(view_method, true)
|
|
||||||
|
|
||||||
jwidget_add_child (box3, label_quality)
|
|
||||||
jwidget_add_child (box3, label_smooth)
|
|
||||||
jwidget_add_child (box4, slider_quality)
|
|
||||||
jwidget_add_child (box4, slider_smooth)
|
|
||||||
jwidget_add_child (box2, box3)
|
|
||||||
jwidget_add_child (box2, box4)
|
|
||||||
jwidget_add_child (box1, box2)
|
|
||||||
jwidget_add_child (box1, label_method)
|
|
||||||
jwidget_add_child (box1, view_method)
|
|
||||||
jwidget_add_child (box5, button_ok)
|
|
||||||
jwidget_add_child (box5, button_cancel)
|
|
||||||
jwidget_add_child (box1, box5)
|
|
||||||
jwidget_add_child (window, box1)
|
|
||||||
|
|
||||||
jwindow_open_fg(window)
|
|
||||||
|
|
||||||
if jwindow_get_killer(window) == button_ok then
|
|
||||||
ret = true
|
|
||||||
|
|
||||||
quality = jslider_get_value(slider_quality)
|
|
||||||
smooth = jslider_get_value(slider_smooth)
|
|
||||||
method = jlistbox_get_selected_index(list_method)
|
|
||||||
|
|
||||||
set_config_int("JPEG", "Quality", quality)
|
|
||||||
set_config_int("JPEG", "Smooth", smooth)
|
|
||||||
set_config_int("JPEG", "Method", method)
|
|
||||||
else
|
|
||||||
ret = false
|
|
||||||
end
|
|
||||||
|
|
||||||
jwidget_free(window)
|
|
||||||
return ret
|
|
||||||
end
|
|
@ -1,9 +0,0 @@
|
|||||||
-- ase -- allegro-sprite-editor: the ultimate sprites factory
|
|
||||||
-- Copyright (C) 2001-2005 by David A. Capello
|
|
||||||
|
|
||||||
function GUI_LoadScriptFile()
|
|
||||||
local filename = ji_file_select(_("Load Script File(.lua)"), "", "lua")
|
|
||||||
if filename then
|
|
||||||
dofile(filename)
|
|
||||||
end
|
|
||||||
end
|
|
BIN
data/tips/ase.pcx
Normal file
BIN
data/tips/ase.pcx
Normal file
Binary file not shown.
Binary file not shown.
@ -2,17 +2,15 @@
|
|||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 David A. Capello
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 David A. Capello
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
\palette aselogo.pcx
|
\palette ase.pcx
|
||||||
\image aselogo.pcx
|
\image ase.pcx
|
||||||
Allegro Sprite Editor
|
|
||||||
|
|
||||||
Welcome to ASE
|
Welcome to ASE 0.6
|
||||||
|
|
||||||
You can find more information about the keyboard shortcuts in the
|
You can find help in ASE Wiki:
|
||||||
"docs/QuickHelp.html" file.
|
http://www.allegrospriteeditor.com.ar/wiki/
|
||||||
|
|
||||||
Report bugs to:
|
Report bugs to:
|
||||||
|
|
||||||
ase-help@lists.sourceforge.net
|
ase-help@lists.sourceforge.net
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
\split
|
\split
|
||||||
@ -115,6 +113,6 @@ directory for some examples.
|
|||||||
\image sprite.pcx
|
\image sprite.pcx
|
||||||
And remember look for updates in:
|
And remember look for updates in:
|
||||||
|
|
||||||
http://ase.sourceforge.net/
|
http://www.allegrospriteeditor.com.ar/
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 by David A. Capello
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 by David A. Capello
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 David A. Capello
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 David A. Capello
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
\palette aselogo.pcx
|
\palette ase.pcx
|
||||||
\image aselogo.pcx
|
\image ase.pcx
|
||||||
Allegro Sprite Editor
|
|
||||||
|
|
||||||
Bienvenido a ASE
|
Bienvenido a ASE 0.6
|
||||||
|
|
||||||
Puede encontrar más información sobre los atajos del teclado en el
|
Puede encontrar ayuda en la Wiki de ASE:
|
||||||
archivo "docs/QuickHelp.html".
|
http://www.allegrospriteeditor.com.ar/wiki/
|
||||||
|
|
||||||
Reporte bugs y errores a:
|
Reporte bugs y errores a:
|
||||||
|
|
||||||
ase-help@lists.sourceforge.net
|
ase-help@lists.sourceforge.net
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
\split
|
\split
|
||||||
@ -117,6 +115,6 @@ tareas repetitivas? Puede buscar la documentaci
|
|||||||
\image sprite.pcx
|
\image sprite.pcx
|
||||||
Y recuerde buscar actualizaciones en:
|
Y recuerde buscar actualizaciones en:
|
||||||
|
|
||||||
http://ase.sourceforge.net/
|
http://www.allegrospriteeditor.com.ar/
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 por David A. Capello
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 por David A. Capello
|
||||||
|
@ -438,21 +438,21 @@ static bool entry_msg_proc (JWidget widget, JMessage msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ustrcmp (widget->text, text) != 0) {
|
if (ustrcmp(widget->text, text) != 0) {
|
||||||
jwidget_set_text (widget, text);
|
jwidget_set_text(widget, text);
|
||||||
jwidget_emit_signal (widget, JI_SIGNAL_ENTRY_CHANGE);
|
jwidget_emit_signal(widget, JI_SIGNAL_ENTRY_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
jfree (text);
|
jfree(text);
|
||||||
|
|
||||||
jentry_set_cursor_pos (widget, entry->cursor);
|
jentry_set_cursor_pos(widget, entry->cursor);
|
||||||
jwidget_dirty (widget);
|
jwidget_dirty(widget);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JM_BUTTONPRESSED:
|
case JM_BUTTONPRESSED:
|
||||||
jwidget_capture_mouse (widget);
|
jwidget_capture_mouse(widget);
|
||||||
|
|
||||||
case JM_MOTION:
|
case JM_MOTION:
|
||||||
if (jwidget_has_capture (widget)) {
|
if (jwidget_has_capture (widget)) {
|
||||||
@ -469,17 +469,17 @@ static bool entry_msg_proc (JWidget widget, JMessage msg)
|
|||||||
entry->cursor = --entry->scroll;
|
entry->cursor = --entry->scroll;
|
||||||
move = FALSE;
|
move = FALSE;
|
||||||
dirty = TRUE;
|
dirty = TRUE;
|
||||||
jwidget_dirty (widget);
|
jwidget_dirty(widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* forward scroll */
|
/* forward scroll */
|
||||||
else if (msg->mouse.x >= widget->rc->x2) {
|
else if (msg->mouse.x >= widget->rc->x2) {
|
||||||
if (entry->scroll < ustrlen (text)) {
|
if (entry->scroll < ustrlen(text)) {
|
||||||
entry->scroll++;
|
entry->scroll++;
|
||||||
x = widget->rc->x1 + widget->border_width.l;
|
x = widget->rc->x1 + widget->border_width.l;
|
||||||
for (c=entry->scroll; ; c++) {
|
for (c=entry->scroll; ; c++) {
|
||||||
x += CHARACTER_LENGTH (widget->text_font,
|
x += CHARACTER_LENGTH(widget->text_font,
|
||||||
(c < ustrlen (text))? ugetat (text, c): ' ');
|
(c < ustrlen (text))? ugetat (text, c): ' ');
|
||||||
if (x > widget->rc->x2-widget->border_width.r) {
|
if (x > widget->rc->x2-widget->border_width.r) {
|
||||||
c--;
|
c--;
|
||||||
break;
|
break;
|
||||||
@ -506,8 +506,10 @@ static bool entry_msg_proc (JWidget widget, JMessage msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* move selection */
|
/* move selection */
|
||||||
if (entry->recent_focused)
|
if (entry->recent_focused) {
|
||||||
entry->recent_focused = FALSE;
|
entry->recent_focused = FALSE;
|
||||||
|
entry->select = entry->cursor;
|
||||||
|
}
|
||||||
else if (msg->type == JM_BUTTONPRESSED)
|
else if (msg->type == JM_BUTTONPRESSED)
|
||||||
entry->select = entry->cursor;
|
entry->select = entry->cursor;
|
||||||
|
|
||||||
@ -527,17 +529,17 @@ static bool entry_msg_proc (JWidget widget, JMessage msg)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case JM_DOUBLECLICK:
|
case JM_DOUBLECLICK:
|
||||||
entry_forward_word (widget);
|
entry_forward_word(widget);
|
||||||
entry->select = entry->cursor;
|
entry->select = entry->cursor;
|
||||||
entry_backward_word (widget);
|
entry_backward_word(widget);
|
||||||
jwidget_dirty (widget);
|
jwidget_dirty(widget);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case JM_MOUSEENTER:
|
case JM_MOUSEENTER:
|
||||||
case JM_MOUSELEAVE:
|
case JM_MOUSELEAVE:
|
||||||
/* XXX theme stuff */
|
/* XXX theme stuff */
|
||||||
if (jwidget_is_enabled (widget))
|
if (jwidget_is_enabled(widget))
|
||||||
jwidget_dirty (widget);
|
jwidget_dirty(widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +63,10 @@ typedef struct Extension
|
|||||||
char *text;
|
char *text;
|
||||||
} Extension;
|
} Extension;
|
||||||
|
|
||||||
static JWidget listbox1, listbox2, entry_path;
|
static JWidget listbox1, listbox2, entry_path, entry_name;
|
||||||
static JList paths, files;
|
static JList paths, files;
|
||||||
|
|
||||||
static char current_path[512];
|
static char current_path[1024];
|
||||||
static JList extensions; /* list of supported Extensions */
|
static JList extensions; /* list of supported Extensions */
|
||||||
|
|
||||||
static bool filesel_msg_proc(JWidget entry, JMessage msg);
|
static bool filesel_msg_proc(JWidget entry, JMessage msg);
|
||||||
@ -95,12 +95,13 @@ char *ji_file_select(const char *message,
|
|||||||
const char *init_path,
|
const char *init_path,
|
||||||
const char *exts)
|
const char *exts)
|
||||||
{
|
{
|
||||||
return ji_file_select_ex (message, init_path, exts, NULL);
|
return ji_file_select_ex(message, init_path, exts, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* customizable widgets:
|
/* customizable widgets:
|
||||||
widget_extension can have childs with these widget's names:
|
widget_extension can have childs with these widget's names:
|
||||||
"entry"
|
"path"
|
||||||
|
"name"
|
||||||
"left"
|
"left"
|
||||||
"top"
|
"top"
|
||||||
"right"
|
"right"
|
||||||
@ -111,26 +112,28 @@ char *ji_file_select_ex(const char *message,
|
|||||||
const char *exts,
|
const char *exts,
|
||||||
JWidget widget_extension)
|
JWidget widget_extension)
|
||||||
{
|
{
|
||||||
JWidget window, box1, box2, box3, panel, view1, view2;
|
JWidget window, box1, box2, box3, box4, panel, view1, view2;
|
||||||
JWidget button_select, button_cancel, tmp;
|
JWidget button_select, button_cancel, tmp;
|
||||||
int size = 256;
|
int size = 1024;
|
||||||
char buf[512];
|
char buf[1024];
|
||||||
JLink link;
|
JLink link;
|
||||||
char *s;
|
char *s;
|
||||||
char *selected_filename;
|
char *selected_filename;
|
||||||
bool entry_created;
|
bool entry_path_created;
|
||||||
|
bool entry_name_created;
|
||||||
|
|
||||||
generate_extensions(exts);
|
generate_extensions(exts);
|
||||||
|
|
||||||
ustrcpy (current_path, init_path);
|
ustrcpy(current_path, init_path);
|
||||||
ustrcpy (get_filename (current_path), empty_string);
|
ustrcpy(get_filename(current_path), empty_string);
|
||||||
|
|
||||||
ustrcpy (buf, init_path);
|
ustrcpy(buf, init_path);
|
||||||
|
|
||||||
window = jwindow_new (message);
|
window = jwindow_new(message);
|
||||||
box1 = jbox_new(JI_VERTICAL);
|
box1 = jbox_new(JI_VERTICAL);
|
||||||
box2 = jbox_new(JI_HORIZONTAL);
|
box2 = jbox_new(JI_HORIZONTAL);
|
||||||
box3 = jbox_new(JI_HORIZONTAL | JI_HOMOGENEOUS);
|
box3 = jbox_new(JI_HORIZONTAL | JI_HOMOGENEOUS);
|
||||||
|
box4 = jbox_new(JI_VERTICAL | JI_EXPANSIVE);
|
||||||
panel = jpanel_new(JI_HORIZONTAL);
|
panel = jpanel_new(JI_HORIZONTAL);
|
||||||
view1 = jview_new();
|
view1 = jview_new();
|
||||||
view2 = jview_new();
|
view2 = jview_new();
|
||||||
@ -141,19 +144,29 @@ char *ji_file_select_ex(const char *message,
|
|||||||
|
|
||||||
/* create input widget (entry_path) */
|
/* create input widget (entry_path) */
|
||||||
entry_path = NULL;
|
entry_path = NULL;
|
||||||
entry_created = FALSE;
|
entry_name = NULL;
|
||||||
|
entry_path_created = FALSE;
|
||||||
|
entry_name_created = FALSE;
|
||||||
|
|
||||||
if (widget_extension)
|
if (widget_extension) {
|
||||||
entry_path = jwidget_find_name (widget_extension, "entry");
|
entry_path = jwidget_find_name(widget_extension, "path");
|
||||||
|
entry_name = jwidget_find_name(widget_extension, "name");
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry_path) {
|
if (!entry_path) {
|
||||||
entry_path = jentry_new (size-1, NULL);
|
entry_path = jentry_new(size-1, NULL);
|
||||||
entry_created = TRUE;
|
entry_path_created = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entry_name) {
|
||||||
|
entry_name = jentry_new(size-1, NULL);
|
||||||
|
entry_name_created = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add hook */
|
/* add hook */
|
||||||
jwidget_add_hook(button_select, filesel_type(), filesel_msg_proc, NULL);
|
jwidget_add_hook(button_select, filesel_type(), filesel_msg_proc, NULL);
|
||||||
jwidget_add_hook(entry_path, filesel_type(), filesel_msg_proc, NULL);
|
jwidget_add_hook(entry_path, filesel_type(), filesel_msg_proc, NULL);
|
||||||
|
jwidget_add_hook(entry_name, filesel_type(), filesel_msg_proc, NULL);
|
||||||
jwidget_add_hook(listbox1, filesel_type(), filesel_msg_proc, listbox2);
|
jwidget_add_hook(listbox1, filesel_type(), filesel_msg_proc, listbox2);
|
||||||
jwidget_add_hook(listbox2, filesel_type(), filesel_msg_proc, listbox1);
|
jwidget_add_hook(listbox2, filesel_type(), filesel_msg_proc, listbox1);
|
||||||
|
|
||||||
@ -167,23 +180,35 @@ char *ji_file_select_ex(const char *message,
|
|||||||
jwidget_expansive(box2, TRUE);
|
jwidget_expansive(box2, TRUE);
|
||||||
|
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "top")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "top")))
|
||||||
jwidget_add_child (box1, tmp);
|
jwidget_add_child(box1, tmp);
|
||||||
if (entry_created)
|
if (entry_path_created)
|
||||||
jwidget_add_child (box1, entry_path);
|
jwidget_add_child(box1, entry_path);
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "left")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "left")))
|
||||||
jwidget_add_child (box2, tmp);
|
jwidget_add_child(box2, tmp);
|
||||||
jwidget_add_child (panel, view1);
|
jwidget_add_child(panel, view1);
|
||||||
jwidget_add_child (panel, view2);
|
jwidget_add_child(panel, view2);
|
||||||
jwidget_add_child (box2, panel);
|
if (!entry_name_created)
|
||||||
|
jwidget_add_child(box2, panel);
|
||||||
|
else {
|
||||||
|
JWidget subbox1 = jbox_new(JI_VERTICAL);
|
||||||
|
JWidget subbox2 = jbox_new(JI_HORIZONTAL);
|
||||||
|
jwidget_expansive(entry_name, TRUE);
|
||||||
|
jwidget_add_child(box2, subbox1);
|
||||||
|
jwidget_add_child(subbox1, panel);
|
||||||
|
jwidget_add_child(subbox1, subbox2);
|
||||||
|
jwidget_add_child(subbox2, jlabel_new(ji_translate_string("File name:")));
|
||||||
|
jwidget_add_child(subbox2, entry_name);
|
||||||
|
}
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "right")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "right")))
|
||||||
jwidget_add_child (box2, tmp);
|
jwidget_add_child(box2, tmp);
|
||||||
jwidget_add_child (box1, box2);
|
jwidget_add_child(box1, box2);
|
||||||
jwidget_add_child (box3, button_select);
|
jwidget_add_child(box3, box4);
|
||||||
jwidget_add_child (box3, button_cancel);
|
jwidget_add_child(box3, button_select);
|
||||||
jwidget_add_child (box1, box3);
|
jwidget_add_child(box3, button_cancel);
|
||||||
|
jwidget_add_child(box1, box3);
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "bottom")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "bottom")))
|
||||||
jwidget_add_child (box1, tmp);
|
jwidget_add_child(box1, tmp);
|
||||||
jwidget_add_child (window, box1);
|
jwidget_add_child(window, box1);
|
||||||
|
|
||||||
/* magnetic */
|
/* magnetic */
|
||||||
jwidget_magnetic(button_select, TRUE);
|
jwidget_magnetic(button_select, TRUE);
|
||||||
@ -199,10 +224,13 @@ char *ji_file_select_ex(const char *message,
|
|||||||
|
|
||||||
/* put the current directory in the entry */
|
/* put the current directory in the entry */
|
||||||
jlistbox_select_child(listbox1, NULL);
|
jlistbox_select_child(listbox1, NULL);
|
||||||
|
|
||||||
|
s = get_filename(buf);
|
||||||
|
if (s > buf) *(s-1) = 0;
|
||||||
jwidget_set_text(entry_path, buf);
|
jwidget_set_text(entry_path, buf);
|
||||||
|
jwidget_set_text(entry_name, s);
|
||||||
|
|
||||||
/* select the filename */
|
/* select the filename */
|
||||||
s = get_filename(buf);
|
|
||||||
JI_LIST_FOR_EACH(listbox2->children, link) {
|
JI_LIST_FOR_EACH(listbox2->children, link) {
|
||||||
if (ustrcmp(s, jwidget_get_text(link->data)) == 0) {
|
if (ustrcmp(s, jwidget_get_text(link->data)) == 0) {
|
||||||
jlistbox_select_child(listbox2, link->data);
|
jlistbox_select_child(listbox2, link->data);
|
||||||
@ -218,16 +246,25 @@ char *ji_file_select_ex(const char *message,
|
|||||||
/* button "select"? */
|
/* button "select"? */
|
||||||
if ((jwindow_get_killer(window) == button_select) ||
|
if ((jwindow_get_killer(window) == button_select) ||
|
||||||
(jwindow_get_killer(window) == listbox2) ||
|
(jwindow_get_killer(window) == listbox2) ||
|
||||||
(jwindow_get_killer(window) == entry_path)) {
|
(jwindow_get_killer(window) == entry_path) ||
|
||||||
|
(jwindow_get_killer(window) == entry_name)) {
|
||||||
/* copy the new name */
|
/* copy the new name */
|
||||||
selected_filename = jstrdup(jwidget_get_text(entry_path));
|
selected_filename = jmalloc(1024);
|
||||||
|
|
||||||
|
ustrcpy(selected_filename, jwidget_get_text(entry_path));
|
||||||
|
put_backslash(selected_filename);
|
||||||
|
ustrcat(selected_filename, jwidget_get_text(entry_name));
|
||||||
|
|
||||||
|
fix_filename_slashes(selected_filename);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* nothing selected */
|
/* nothing selected */
|
||||||
selected_filename = NULL;
|
selected_filename = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "entry")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "path")))
|
||||||
|
jwidget_remove_child(tmp->parent, tmp);
|
||||||
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "name")))
|
||||||
jwidget_remove_child(tmp->parent, tmp);
|
jwidget_remove_child(tmp->parent, tmp);
|
||||||
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "left")))
|
if (widget_extension && (tmp = jwidget_find_name(widget_extension, "left")))
|
||||||
jwidget_remove_child(tmp->parent, tmp);
|
jwidget_remove_child(tmp->parent, tmp);
|
||||||
@ -254,29 +291,30 @@ void ji_file_select_refresh_listbox(void)
|
|||||||
fill_listbox_with_files(current_path, sizeof(current_path));
|
fill_listbox_with_files(current_path, sizeof(current_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ji_file_select_enter_to_path (const char *path)
|
void ji_file_select_enter_to_path(const char *path)
|
||||||
{
|
{
|
||||||
jwidget_set_text (entry_path, path);
|
jwidget_set_text(entry_path, path);
|
||||||
enter_to_path_in_entry ();
|
jwidget_set_text(entry_name, "");
|
||||||
|
enter_to_path_in_entry();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ji_dir_exists (const char *filename)
|
bool ji_dir_exists(const char *filename)
|
||||||
{
|
{
|
||||||
struct al_ffblk info;
|
struct al_ffblk info;
|
||||||
char buf[512];
|
char buf[1024];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ustrcpy (buf, filename);
|
ustrcpy(buf, filename);
|
||||||
put_backslash (buf);
|
put_backslash(buf);
|
||||||
ustrcat (buf, "*.*");
|
ustrcat(buf, "*.*");
|
||||||
|
|
||||||
ret = al_findfirst (buf, &info, FA_ALL);
|
ret = al_findfirst(buf, &info, FA_ALL);
|
||||||
al_findclose (&info);
|
al_findclose(&info);
|
||||||
|
|
||||||
return (ret == 0);
|
return (ret == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool filesel_msg_proc (JWidget widget, JMessage msg)
|
static bool filesel_msg_proc(JWidget widget, JMessage msg)
|
||||||
{
|
{
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
|
|
||||||
@ -284,43 +322,49 @@ static bool filesel_msg_proc (JWidget widget, JMessage msg)
|
|||||||
switch (msg->signal.num) {
|
switch (msg->signal.num) {
|
||||||
|
|
||||||
case JI_SIGNAL_BUTTON_SELECT:
|
case JI_SIGNAL_BUTTON_SELECT:
|
||||||
if (!enter_to_path_in_entry ())
|
if (!enter_to_path_in_entry())
|
||||||
jwidget_close_window (widget);
|
jwidget_close_window(widget);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case JI_SIGNAL_LISTBOX_SELECT: {
|
case JI_SIGNAL_LISTBOX_SELECT: {
|
||||||
const char *text;
|
char filename[1024];
|
||||||
int attr;
|
int attr;
|
||||||
enter_to_path_in_entry ();
|
enter_to_path_in_entry();
|
||||||
jmanager_set_focus (widget);
|
jmanager_set_focus(widget);
|
||||||
|
|
||||||
/* close the window when we double-click in a normal file */
|
/* close the window when we double-click in a normal file */
|
||||||
text = jwidget_get_text (entry_path);
|
ustrcpy(filename, jwidget_get_text(entry_path));
|
||||||
if (file_exists (text, FA_ALL, &attr)) {
|
put_backslash(filename);
|
||||||
|
ustrcat(filename, jwidget_get_text(entry_name));
|
||||||
|
|
||||||
|
if (file_exists(filename, FA_ALL, &attr)) {
|
||||||
if (!(attr & FA_DIREC))
|
if (!(attr & FA_DIREC))
|
||||||
jwidget_close_window (widget);
|
jwidget_close_window(widget);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case JI_SIGNAL_LISTBOX_CHANGE: {
|
case JI_SIGNAL_LISTBOX_CHANGE: {
|
||||||
JWidget the_other_listbox = jwidget_get_data (widget,
|
JWidget the_other_listbox = jwidget_get_data(widget,
|
||||||
filesel_type ());
|
filesel_type());
|
||||||
JWidget item = jlistbox_get_selected_child (widget);
|
JWidget item = jlistbox_get_selected_child(widget);
|
||||||
const char *filename = item ? jwidget_get_text (item):
|
const char *filename = item ? jwidget_get_text(item):
|
||||||
empty_string;
|
empty_string;
|
||||||
char buf[512];
|
|
||||||
|
|
||||||
jwidget_signal_off (the_other_listbox);
|
jwidget_signal_off(the_other_listbox);
|
||||||
jlistbox_select_child (the_other_listbox, 0);
|
jlistbox_select_child(the_other_listbox, 0);
|
||||||
jwidget_signal_on (the_other_listbox);
|
jwidget_signal_on(the_other_listbox);
|
||||||
|
|
||||||
/* get `current_path + current_item_in_list' */
|
jwidget_set_text(entry_path, current_path);
|
||||||
replace_filename (buf, current_path, filename, sizeof (buf));
|
jwidget_set_text(entry_name, filename);
|
||||||
|
jentry_select_text(entry_name, 0, -1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* set the text in the edit box */
|
case JI_SIGNAL_ENTRY_CHANGE: {
|
||||||
jwidget_set_text (entry_path, buf);
|
if (widget == entry_path) {
|
||||||
jentry_select_text (entry_path, get_filename (buf)-buf, -1);
|
jwidget_set_text(entry_name, "");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,12 +374,12 @@ static bool filesel_msg_proc (JWidget widget, JMessage msg)
|
|||||||
if ((jwidget_has_focus (widget)) &&
|
if ((jwidget_has_focus (widget)) &&
|
||||||
((msg->key.scancode == KEY_ENTER) ||
|
((msg->key.scancode == KEY_ENTER) ||
|
||||||
(msg->key.scancode == KEY_ENTER_PAD))) {
|
(msg->key.scancode == KEY_ENTER_PAD))) {
|
||||||
if (enter_to_path_in_entry ()) {
|
if (enter_to_path_in_entry()) {
|
||||||
jmanager_set_focus (widget);
|
jmanager_set_focus(widget);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
jwidget_close_window (widget);
|
jwidget_close_window(widget);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,59 +389,62 @@ static bool filesel_msg_proc (JWidget widget, JMessage msg)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool enter_to_path_in_entry (void)
|
static bool enter_to_path_in_entry(void)
|
||||||
{
|
{
|
||||||
const char *filename = jwidget_get_text (entry_path);
|
char buf[1024], path[1024], from[1024];
|
||||||
char buf[512], path[512], from[512];
|
const char *filename;
|
||||||
JLink link;
|
JLink link;
|
||||||
|
|
||||||
jmanager_set_focus (entry_path);
|
jmanager_set_focus(entry_path);
|
||||||
|
|
||||||
fix_filename_path (path, filename, sizeof (path));
|
fix_filename_path(path, jwidget_get_text(entry_path), sizeof(path));
|
||||||
fixup_filename (buf, from, path);
|
put_backslash(path);
|
||||||
ustrcpy (path, buf);
|
ustrcat(path, jwidget_get_text(entry_name));
|
||||||
|
|
||||||
|
fixup_filename(buf, from, path);
|
||||||
|
ustrcpy(path, buf);
|
||||||
|
|
||||||
#ifdef HAVE_DRIVES
|
#ifdef HAVE_DRIVES
|
||||||
if (ugetat (buf, -1) == DEVICE_SEPARATOR) {
|
if (ugetat (buf, -1) == DEVICE_SEPARATOR) {
|
||||||
uinsert (path, ustrlen (path), OTHER_PATH_SEPARATOR);
|
uinsert(path, ustrlen (path), OTHER_PATH_SEPARATOR);
|
||||||
ustrcat (buf, "./");
|
ustrcat(buf, "./");
|
||||||
}
|
}
|
||||||
else if ((ugetat (buf, -1) == OTHER_PATH_SEPARATOR) &&
|
else if ((ugetat (buf, -1) == OTHER_PATH_SEPARATOR) &&
|
||||||
(ugetat (buf, -2) == DEVICE_SEPARATOR)) {
|
(ugetat (buf, -2) == DEVICE_SEPARATOR)) {
|
||||||
uremove (buf, -1);
|
uremove(buf, -1);
|
||||||
ustrcat (buf, "./");
|
ustrcat(buf, "./");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ji_dir_exists (buf)) {
|
if (ji_dir_exists(buf)) {
|
||||||
ustrcpy (buf, path);
|
ustrcpy(buf, path);
|
||||||
put_backslash (buf);
|
put_backslash(buf);
|
||||||
|
|
||||||
ustrcpy (current_path, buf);
|
ustrcpy(current_path, buf);
|
||||||
|
|
||||||
/* make the new list of files */
|
/* make the new list of files */
|
||||||
fill_listbox_with_files (buf, sizeof (buf));
|
fill_listbox_with_files(buf, sizeof(buf));
|
||||||
|
|
||||||
/* change the edit text */
|
/* change the edit text */
|
||||||
jwidget_set_text (entry_path, buf);
|
jwidget_set_text(entry_path, buf);
|
||||||
jentry_select_text (entry_path, 0, -1);
|
jentry_select_text(entry_path, 0, -1);
|
||||||
|
|
||||||
/* select the filename */
|
/* select the filename */
|
||||||
if (!ugetat (from, 0))
|
if (!ugetat(from, 0))
|
||||||
ustrcpy (from, "..");
|
ustrcpy(from, "..");
|
||||||
|
|
||||||
JI_LIST_FOR_EACH(listbox1->children, link) {
|
JI_LIST_FOR_EACH(listbox1->children, link) {
|
||||||
filename = jwidget_get_text(link->data);
|
filename = jwidget_get_text(link->data);
|
||||||
|
|
||||||
#ifdef HAVE_DRIVES
|
#ifdef HAVE_DRIVES
|
||||||
if (ustricmp (filename, from) == 0)
|
if (ustricmp(filename, from) == 0)
|
||||||
#else
|
#else
|
||||||
if (ustrcmp (filename, from) == 0)
|
if (ustrcmp(filename, from) == 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
JWidget listitem = jlistbox_get_selected_child(listbox1);
|
JWidget listitem = jlistbox_get_selected_child(listbox1);
|
||||||
if (listitem)
|
if (listitem)
|
||||||
jwidget_deselect (listitem);
|
jwidget_deselect(listitem);
|
||||||
jlistbox_select_child(listbox1, link->data);
|
jlistbox_select_child(listbox1, link->data);
|
||||||
jlistbox_center_scroll(listbox1);
|
jlistbox_center_scroll(listbox1);
|
||||||
break;
|
break;
|
||||||
@ -415,7 +462,7 @@ static void fill_listbox_callback(const char *filename, int attrib, int param)
|
|||||||
const char *other_filename;
|
const char *other_filename;
|
||||||
JList *list;
|
JList *list;
|
||||||
JLink link;
|
JLink link;
|
||||||
char buf[512];
|
char buf[1024];
|
||||||
bool found;
|
bool found;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
@ -428,11 +475,11 @@ static void fill_listbox_callback(const char *filename, int attrib, int param)
|
|||||||
/* only files with an acceptable extension */
|
/* only files with an acceptable extension */
|
||||||
else {
|
else {
|
||||||
list = &files;
|
list = &files;
|
||||||
found = check_extension(get_extension (filename));
|
found = check_extension(get_extension(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
ustrzcpy(buf, sizeof (buf), get_filename(filename));
|
ustrzcpy(buf, sizeof(buf), get_filename(filename));
|
||||||
fix_filename_case(buf);
|
fix_filename_case(buf);
|
||||||
|
|
||||||
if (attrib & FA_DIREC) {
|
if (attrib & FA_DIREC) {
|
||||||
@ -452,7 +499,7 @@ static void fill_listbox_callback(const char *filename, int attrib, int param)
|
|||||||
|
|
||||||
static void fill_listbox_with_files(char *path, int size)
|
static void fill_listbox_with_files(char *path, int size)
|
||||||
{
|
{
|
||||||
char buf[512], tmp[32];
|
char buf[1024], tmp[32];
|
||||||
int ch, attr;
|
int ch, attr;
|
||||||
JList list;
|
JList list;
|
||||||
JLink link;
|
JLink link;
|
||||||
@ -505,8 +552,8 @@ static void fill_listbox_with_files(char *path, int size)
|
|||||||
|
|
||||||
for_each_file(buf, FA_TO_SHOW, fill_listbox_callback, 0);
|
for_each_file(buf, FA_TO_SHOW, fill_listbox_callback, 0);
|
||||||
|
|
||||||
JI_LIST_FOR_EACH(paths, link) jwidget_add_child (listbox1, link->data);
|
JI_LIST_FOR_EACH(paths, link) jwidget_add_child(listbox1, link->data);
|
||||||
JI_LIST_FOR_EACH(files, link) jwidget_add_child (listbox2, link->data);
|
JI_LIST_FOR_EACH(files, link) jwidget_add_child(listbox2, link->data);
|
||||||
|
|
||||||
jlist_free(paths);
|
jlist_free(paths);
|
||||||
jlist_free(files);
|
jlist_free(files);
|
||||||
@ -524,7 +571,7 @@ static void fill_listbox_with_files(char *path, int size)
|
|||||||
|
|
||||||
static void generate_extensions(const char *exts)
|
static void generate_extensions(const char *exts)
|
||||||
{
|
{
|
||||||
char *tok, buf[512];
|
char *tok, buf[1024];
|
||||||
Extension *ext;
|
Extension *ext;
|
||||||
|
|
||||||
extensions = jlist_new();
|
extensions = jlist_new();
|
||||||
@ -564,7 +611,7 @@ static void generate_extensions(const char *exts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_extension (const char *filename_ext)
|
static bool check_extension(const char *filename_ext)
|
||||||
{
|
{
|
||||||
Extension *ext;
|
Extension *ext;
|
||||||
JLink link;
|
JLink link;
|
||||||
@ -581,18 +628,18 @@ static bool check_extension (const char *filename_ext)
|
|||||||
switch (ext->type) {
|
switch (ext->type) {
|
||||||
|
|
||||||
case EQUAL_TO_TEXT:
|
case EQUAL_TO_TEXT:
|
||||||
if (ustricmp (ext->text, filename_ext) == 0)
|
if (ustricmp(ext->text, filename_ext) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case START_WITH_TEXT:
|
case START_WITH_TEXT:
|
||||||
if (my_ustrnicmp (ext->text, filename_ext, ext->size) == 0)
|
if (my_ustrnicmp(ext->text, filename_ext, ext->size) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case END_WITH_TEXT:
|
case END_WITH_TEXT:
|
||||||
if (len >= ext->size &&
|
if (len >= ext->size &&
|
||||||
my_ustrnicmp (ext->text, filename_ext+len-ext->size, ext->size) == 0)
|
my_ustrnicmp(ext->text, filename_ext+len-ext->size, ext->size) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -35,19 +35,19 @@
|
|||||||
|
|
||||||
static bool label_msg_proc (JWidget widget, JMessage msg);
|
static bool label_msg_proc (JWidget widget, JMessage msg);
|
||||||
|
|
||||||
JWidget jlabel_new (const char *text)
|
JWidget jlabel_new(const char *text)
|
||||||
{
|
{
|
||||||
JWidget widget = jwidget_new (JI_LABEL);
|
JWidget widget = jwidget_new(JI_LABEL);
|
||||||
|
|
||||||
jwidget_add_hook (widget, JI_LABEL, label_msg_proc, NULL);
|
jwidget_add_hook(widget, JI_LABEL, label_msg_proc, NULL);
|
||||||
jwidget_set_align (widget, JI_LEFT | JI_MIDDLE);
|
jwidget_set_align(widget, JI_LEFT | JI_MIDDLE);
|
||||||
jwidget_set_text (widget, text);
|
jwidget_set_text(widget, text);
|
||||||
jwidget_init_theme (widget);
|
jwidget_init_theme(widget);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool label_msg_proc (JWidget widget, JMessage msg)
|
static bool label_msg_proc(JWidget widget, JMessage msg)
|
||||||
{
|
{
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
|
|
||||||
|
@ -15,8 +15,7 @@ endif
|
|||||||
# Flags for MinGW
|
# Flags for MinGW
|
||||||
|
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
# LFLAGS = -mwindows
|
LFLAGS = -mwindows
|
||||||
LFLAGS = -mconsole
|
|
||||||
ifdef DEBUGMODE
|
ifdef DEBUGMODE
|
||||||
LFLAGS_LAST = -lalld
|
LFLAGS_LAST = -lalld
|
||||||
else
|
else
|
||||||
|
@ -22,12 +22,15 @@
|
|||||||
|
|
||||||
#include "jinete.h"
|
#include "jinete.h"
|
||||||
|
|
||||||
#include "core/app.h"
|
#include "script/script.h"
|
||||||
#include "modules/sprites.h"
|
|
||||||
#include "raster/sprite.h"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void command_execute_run_script(const char *argument)
|
void command_execute_run_script(const char *argument)
|
||||||
{
|
{
|
||||||
|
char *filename = ji_file_select(_("Load Script File(.lua)"), "", "lua");
|
||||||
|
if (filename) {
|
||||||
|
do_script_file(filename);
|
||||||
|
jfree(filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,6 @@ bool command_enabled_despeckle(const char *argument);
|
|||||||
void command_execute_despeckle(const char *argument);
|
void command_execute_despeckle(const char *argument);
|
||||||
/* void command_execute_draw_text(const char *argument); */
|
/* void command_execute_draw_text(const char *argument); */
|
||||||
/* void command_execute_play_flic(const char *argument); */
|
/* void command_execute_play_flic(const char *argument); */
|
||||||
/* void command_execute_mapgen(const char *argument); */
|
|
||||||
void command_execute_run_script(const char *argument);
|
void command_execute_run_script(const char *argument);
|
||||||
void command_execute_tips(const char *argument);
|
void command_execute_tips(const char *argument);
|
||||||
void command_execute_options(const char *argument);
|
void command_execute_options(const char *argument);
|
||||||
@ -263,7 +262,7 @@ static Command commands[] = {
|
|||||||
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
|
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
|
||||||
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
|
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
|
||||||
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */
|
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */
|
||||||
{ CMD_RUN_SCRIPT, NULL, NULL, NULL, NULL },
|
CMD_EXE(run_script),
|
||||||
CMD_EXE(tips),
|
CMD_EXE(tips),
|
||||||
CMD_EXE(options),
|
CMD_EXE(options),
|
||||||
CMD_EXE_ENA_CHK(select_file),
|
CMD_EXE_ENA_CHK(select_file),
|
||||||
|
@ -73,7 +73,7 @@ char *GUI_FileSelect(const char *message,
|
|||||||
{
|
{
|
||||||
JWidget box_left, button_home;
|
JWidget box_left, button_home;
|
||||||
JWidget button_fonts, button_palettes, button_mkdir;
|
JWidget button_fonts, button_palettes, button_mkdir;
|
||||||
JWidget box_top, box_top2, combobox, add_bookmark, del_bookmark, entry;
|
JWidget box_top, box_top2, combobox, add_bookmark, del_bookmark, entry_path;
|
||||||
JWidget widget_extension;
|
JWidget widget_extension;
|
||||||
char buf[512], *selected_filename;
|
char buf[512], *selected_filename;
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ char *GUI_FileSelect(const char *message,
|
|||||||
box_top = jbox_new(JI_HORIZONTAL);
|
box_top = jbox_new(JI_HORIZONTAL);
|
||||||
box_top2 = jbox_new(JI_HORIZONTAL | JI_HOMOGENEOUS);
|
box_top2 = jbox_new(JI_HORIZONTAL | JI_HOMOGENEOUS);
|
||||||
combobox = jcombobox_new();
|
combobox = jcombobox_new();
|
||||||
entry = jcombobox_get_entry_widget(combobox);
|
entry_path = jcombobox_get_entry_widget(combobox);
|
||||||
add_bookmark = jbutton_new("+");
|
add_bookmark = jbutton_new("+");
|
||||||
del_bookmark = jbutton_new("-");
|
del_bookmark = jbutton_new("-");
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ char *GUI_FileSelect(const char *message,
|
|||||||
widget_extension = jwidget_new(JI_WIDGET);
|
widget_extension = jwidget_new(JI_WIDGET);
|
||||||
jwidget_set_name(box_left, "left");
|
jwidget_set_name(box_left, "left");
|
||||||
jwidget_set_name(box_top, "top");
|
jwidget_set_name(box_top, "top");
|
||||||
jwidget_set_name(entry, "entry");
|
jwidget_set_name(entry_path, "path");
|
||||||
jwidget_add_childs(widget_extension, box_left, box_top, NULL);
|
jwidget_add_childs(widget_extension, box_left, box_top, NULL);
|
||||||
|
|
||||||
/* call the jinete file selector */
|
/* call the jinete file selector */
|
||||||
@ -310,7 +310,7 @@ static void home_command(JWidget widget)
|
|||||||
get_executable_name (path, sizeof (path));
|
get_executable_name (path, sizeof (path));
|
||||||
*get_filename (path) = 0;
|
*get_filename (path) = 0;
|
||||||
|
|
||||||
ji_file_select_enter_to_path (path);
|
ji_file_select_enter_to_path(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,12 +123,12 @@ void dialogs_tips(bool forced)
|
|||||||
jwidget_add_child(vbox, hbox);
|
jwidget_add_child(vbox, hbox);
|
||||||
jwidget_add_child(window, vbox);
|
jwidget_add_child(window, vbox);
|
||||||
|
|
||||||
if (JI_SCREEN_W > 320)
|
/* if (JI_SCREEN_W > 320) */
|
||||||
jwidget_set_static_size(window,
|
jwidget_set_static_size(window,
|
||||||
MIN(400, JI_SCREEN_W-32),
|
MIN(400, JI_SCREEN_W-32),
|
||||||
MIN(300, JI_SCREEN_H-32));
|
MIN(300, JI_SCREEN_H-16));
|
||||||
else
|
/* else */
|
||||||
jwidget_set_static_size(window, 282, 182);
|
/* jwidget_set_static_size(window, 282, 200); */
|
||||||
|
|
||||||
/* open the window */
|
/* open the window */
|
||||||
jwindow_open(window);
|
jwindow_open(window);
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "jinete.h"
|
||||||
|
|
||||||
#include "console/console.h"
|
#include "console/console.h"
|
||||||
#include "core/app.h"
|
#include "core/app.h"
|
||||||
#include "core/cfg.h"
|
#include "core/cfg.h"
|
||||||
@ -553,26 +555,86 @@ FileType filetype_jpeg = { "jpeg", "jpeg,jpg", NULL, NULL, 0 };
|
|||||||
|
|
||||||
#if defined HAVE_LIBJPEG || HAVE_JPGALLEG
|
#if defined HAVE_LIBJPEG || HAVE_JPGALLEG
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the JPEG configuration dialog.
|
||||||
|
*/
|
||||||
static int configure_jpeg(void)
|
static int configure_jpeg(void)
|
||||||
{
|
{
|
||||||
|
JWidget window, box1, box2, box3, box4, box5;
|
||||||
|
JWidget label_quality, label_smooth, label_method;
|
||||||
|
JWidget slider_quality, slider_smooth, view_method;
|
||||||
|
JWidget list_method, button_ok, button_cancel;
|
||||||
|
int ret, quality, smooth, method;
|
||||||
|
|
||||||
/* interactive mode */
|
/* interactive mode */
|
||||||
if (is_interactive()) {
|
if (!is_interactive())
|
||||||
lua_State *L = get_lua_state();
|
return 0;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* call the ConfigureJPEG() script routine, it must return "true"
|
/* configuration parameters */
|
||||||
to save the image */
|
quality = get_config_int("JPEG", "Quality", 100);
|
||||||
lua_pushstring(L, "ConfigureJPEG");
|
smooth = get_config_int("JPEG", "Smooth", 0);
|
||||||
lua_gettable(L, LUA_GLOBALSINDEX);
|
method = get_config_int("JPEG", "Method", 0);
|
||||||
do_script_raw(L, 0, 1);
|
|
||||||
ret = lua_toboolean(L, -1);
|
|
||||||
lua_pop(L, 1);
|
|
||||||
|
|
||||||
if (!ret)
|
/* widgets */
|
||||||
return -1;
|
window = jwindow_new(_("Configure JPEG Compression"));
|
||||||
|
box1 = jbox_new(JI_VERTICAL);
|
||||||
|
box2 = jbox_new(JI_HORIZONTAL);
|
||||||
|
box3 = jbox_new(JI_VERTICAL + JI_HOMOGENEOUS);
|
||||||
|
box4 = jbox_new(JI_VERTICAL + JI_HOMOGENEOUS);
|
||||||
|
box5 = jbox_new(JI_HORIZONTAL + JI_HOMOGENEOUS);
|
||||||
|
label_quality = jlabel_new(_("Quality:"));
|
||||||
|
label_smooth = jlabel_new(_("Smooth:"));
|
||||||
|
label_method = jlabel_new(_("Method:"));
|
||||||
|
slider_quality = jslider_new(0, 100, quality);
|
||||||
|
slider_smooth = jslider_new(0, 100, smooth);
|
||||||
|
view_method = jview_new();
|
||||||
|
list_method = jlistbox_new();
|
||||||
|
button_ok = jbutton_new(_("&OK"));
|
||||||
|
button_cancel = jbutton_new(_("&Cancel"));
|
||||||
|
|
||||||
|
jwidget_add_child(list_method, jlistitem_new(_("Slow")));
|
||||||
|
jwidget_add_child(list_method, jlistitem_new(_("Fast")));
|
||||||
|
jwidget_add_child(list_method, jlistitem_new(_("Float")));
|
||||||
|
jlistbox_select_index(list_method, method);
|
||||||
|
|
||||||
|
jview_attach(view_method, list_method);
|
||||||
|
jview_maxsize(view_method);
|
||||||
|
|
||||||
|
jwidget_expansive(box4, TRUE);
|
||||||
|
jwidget_expansive(view_method, TRUE);
|
||||||
|
|
||||||
|
jwidget_add_child(box3, label_quality);
|
||||||
|
jwidget_add_child(box3, label_smooth);
|
||||||
|
jwidget_add_child(box4, slider_quality);
|
||||||
|
jwidget_add_child(box4, slider_smooth);
|
||||||
|
jwidget_add_child(box2, box3);
|
||||||
|
jwidget_add_child(box2, box4);
|
||||||
|
jwidget_add_child(box1, box2);
|
||||||
|
jwidget_add_child(box1, label_method);
|
||||||
|
jwidget_add_child(box1, view_method);
|
||||||
|
jwidget_add_child(box5, button_ok);
|
||||||
|
jwidget_add_child(box5, button_cancel);
|
||||||
|
jwidget_add_child(box1, box5);
|
||||||
|
jwidget_add_child(window, box1);
|
||||||
|
|
||||||
|
jwindow_open_fg(window);
|
||||||
|
|
||||||
|
if (jwindow_get_killer(window) == button_ok) {
|
||||||
|
ret = TRUE;
|
||||||
|
|
||||||
|
quality = jslider_get_value(slider_quality);
|
||||||
|
smooth = jslider_get_value(slider_smooth);
|
||||||
|
method = jlistbox_get_selected_index(list_method);
|
||||||
|
|
||||||
|
set_config_int("JPEG", "Quality", quality);
|
||||||
|
set_config_int("JPEG", "Smooth", smooth);
|
||||||
|
set_config_int("JPEG", "Method", method);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ret = FALSE;
|
||||||
|
|
||||||
return 0;
|
jwidget_free(window);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* ase -- allegro-sprite-editor: the ultimate sprites factory
|
/* ase -- allegro-sprite-editor: the ultimate sprites factory
|
||||||
* Copyright (C) 2001-2005 David A. Capello
|
* Copyright (C) 2001-2005, 2007 David A. Capello
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -127,8 +127,8 @@ static DATA gfx_data[GFX_BITMAP_COUNT] =
|
|||||||
" ### "
|
" ### "
|
||||||
" ## "
|
" ## "
|
||||||
" ## "
|
" ## "
|
||||||
" ##"
|
" # "
|
||||||
" ##"
|
" #"
|
||||||
" ###"
|
" ###"
|
||||||
" #### " },
|
" #### " },
|
||||||
/* GFX_TOOL_FLOODFILL */
|
/* GFX_TOOL_FLOODFILL */
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
|
|
||||||
|
#ifdef ALLEGRO_WINDOWS
|
||||||
|
#include <winalleg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "jinete.h"
|
#include "jinete.h"
|
||||||
#include "jinete/intern.h"
|
#include "jinete/intern.h"
|
||||||
|
|
||||||
@ -305,8 +309,6 @@ void gui_feedback(void)
|
|||||||
|
|
||||||
/* jmanager_dispatch_draw_messages(); */
|
/* jmanager_dispatch_draw_messages(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
rest(0); /* don't eat CPU... rest some time */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_setup_screen(void)
|
void gui_setup_screen(void)
|
||||||
@ -688,6 +690,8 @@ static bool manager_msg_proc(JWidget widget, JMessage msg)
|
|||||||
|
|
||||||
case JM_IDLE:
|
case JM_IDLE:
|
||||||
gui_feedback();
|
gui_feedback();
|
||||||
|
/* don't eat CPU... rest some time */
|
||||||
|
rest(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JM_CHAR: {
|
case JM_CHAR: {
|
||||||
|
@ -35,6 +35,10 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ======================================= */
|
||||||
|
/* Sprite */
|
||||||
|
/* ======================================= */
|
||||||
|
|
||||||
/* ======================================= */
|
/* ======================================= */
|
||||||
/* Layer */
|
/* Layer */
|
||||||
/* ======================================= */
|
/* ======================================= */
|
||||||
|
@ -19,10 +19,17 @@
|
|||||||
#ifndef SCRIPT_FUNCTIONS_H
|
#ifndef SCRIPT_FUNCTIONS_H
|
||||||
#define SCRIPT_FUNCTIONS_H
|
#define SCRIPT_FUNCTIONS_H
|
||||||
|
|
||||||
|
struct Sprite;
|
||||||
struct Layer;
|
struct Layer;
|
||||||
struct Frame;
|
struct Frame;
|
||||||
|
|
||||||
/* Layer */
|
/* ======================================= */
|
||||||
|
/* Sprite */
|
||||||
|
/* ======================================= */
|
||||||
|
|
||||||
|
/* ======================================= */
|
||||||
|
/* Layer */
|
||||||
|
/* ======================================= */
|
||||||
|
|
||||||
char *GetUniqueLayerName(void);
|
char *GetUniqueLayerName(void);
|
||||||
|
|
||||||
@ -32,7 +39,9 @@ void RemoveLayer(void);
|
|||||||
|
|
||||||
struct Layer *FlattenLayers(void);
|
struct Layer *FlattenLayers(void);
|
||||||
|
|
||||||
/* Frame */
|
/* ======================================= */
|
||||||
|
/* Frame */
|
||||||
|
/* ======================================= */
|
||||||
|
|
||||||
void RemoveFrame(struct Layer *layer, struct Frame *frame);
|
void RemoveFrame(struct Layer *layer, struct Frame *frame);
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "jinete.h"
|
#include "jinete.h"
|
||||||
|
|
||||||
|
#include "commands/commands.h"
|
||||||
#include "modules/editors.h"
|
#include "modules/editors.h"
|
||||||
#include "modules/gfx.h"
|
#include "modules/gfx.h"
|
||||||
#include "modules/gui.h"
|
#include "modules/gui.h"
|
||||||
@ -373,7 +374,7 @@ static void button_command(JWidget widget, void *data)
|
|||||||
switch ((int)data) {
|
switch ((int)data) {
|
||||||
|
|
||||||
case ACTION_LAYER:
|
case ACTION_LAYER:
|
||||||
do_script_expr("GUI_LayerProperties()");
|
command_execute(command_get_by_name(CMD_LAYER_PROPERTIES), NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_FIRST:
|
case ACTION_FIRST:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user