[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] XaAES Extended Textures patch
Here the first "fluff" patch
For those unfamiliar with this section of XaAES, and maybe concerned
about resource use. The textures were already allocated, just unused
by a custom texture. You will notice that the way the new textures are
added, if they are not present, then you will not see any changes in
resource usage. There maybe increased memory usage for new texture
allocation, but the code reuses the same variable to load all
textures, so I hazard a guess that unless the texture is large (like
the old slider bar texture hack, 720x720) you will not see any change,
possibly eve a reduction when using EcoGreen, simply because of
reduced texture sizes
The texturing is layered cumulatively
As far as Helmut and Ozk branches are concern, it is line compatible.
There are quite a few changes in Ozk, but only to function calling,
with 1 new line at the top, so it should not fail (none of his changes
are near these additions)
THEMES.TXT
At the top is a short discussion and outline of there related
functions within XaAES
At the bottom is a new file which outlines the naming convention of
the new textures, and where all textures overlay
Paul
----
added loading of extended textures for XaAES
diff -u cvs-src.km/win_draw.c src.km/win_draw.c
--- cvs-src.km/win_draw.c 2010-01-12 04:57:49.000000000 +1100
+++ src.km/win_draw.c 2010-01-12 05:09:25.000000000 +1100
@@ -3779,6 +3779,65 @@
set_texture(m, &def_utop_cols.hslide, t);
}
#endif
+
+ /* allow seperate slider textures */
+ if ((t = load_texture(m, "vslider.img")))
+ {
+ set_texture(m, &def_otop_cols.vslider, t);
+ set_texture(m, &def_utop_cols.vslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_otop_cols.vslider, t);
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "vslide.img")))
+ {
+ set_texture(m, &def_otop_cols.vslide, t);
+ set_texture(m, &def_utop_cols.vslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_otop_cols.vslide, t);
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+#endif
+ }
+
+ /* allow seperate unfocused textures */
+ if ((t = load_texture(m, "slideru.img")))
+ {
+ set_texture(m, &def_utop_cols.vslider, t);
+ set_texture(m, &def_utop_cols.hslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+ set_texture(m, &slist_def_utop_cols.hslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "slideu.img")))
+ {
+ set_texture(m, &def_utop_cols.vslide, t);
+ set_texture(m, &def_utop_cols.hslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+ set_texture(m, &slist_def_utop_cols.hslide, t);
+#endif
+ }
+
+ /* allow seperate unfocused slider textures */
+ if ((t = load_texture(m, "vslideru.img")))
+ {
+ set_texture(m, &def_utop_cols.vslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "vslideu.img")))
+ {
+ set_texture(m, &def_utop_cols.vslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+#endif
+ }
}
static void
@@ -3786,31 +3845,54 @@
{
struct widg_texture *t;
+ /* info bar */
if ((t = load_texture(m, "info.img"))) //"lgrey008.img")))
{
set_texture(m, &def_otop_cols.info, t);
set_texture(m, &def_utop_cols.info, t);
}
+
+ /* unfocused info bar */
+ if ((t = load_texture(m, "infou.img")))
+ {
+ set_texture(m, &def_utop_cols.info, t);
+ }
}
static void
title_texture(struct module *m)
{
struct widg_texture *t;
+ /* window bar */
t = load_texture(m, "wtitle.img");
-
if (t) //((t = load_texture(m, "wtitle.img")))
{
set_texture(m, &def_otop_cols.title, t);
set_texture(m, &def_utop_cols.title, t);
}
+
+ /* unfocused window bar */
+ t = load_texture(m, "wtitleu.img");
+ if (t) //((t = load_texture(m, "wtitle.img")))
+ {
+ set_texture(m, &def_utop_cols.title, t);
+ }
+
#ifndef ST_ONLY
+ /* fileselector bar */
t = load_texture(m, "slwtitle.img");
if (t)
{
set_texture(m, &slist_def_otop_cols.title, t);
set_texture(m, &slist_def_utop_cols.title, t);
}
+
+ /* unfocused fileselector bar */
+ t = load_texture(m, "ulwtitle.img");
+ if (t)
+ {
+ set_texture(m, &slist_def_utop_cols.title, t);
+ }
#endif
}
@@ -3831,6 +3913,7 @@
info_texture(m);
title_texture(m);
+ /* background texture */
if ((t = load_texture(m, "exterior.img"))) //grey8b.img")))
{
// foreach_widget(struct module *m, struct window_colours *wc,
void(*f)(struct xa_wcol_inf *wci, void *d), void *parms)
@@ -3839,6 +3922,12 @@
#ifndef ST_ONLY
foreach_widget(m, &slist_def_otop_cols, installtexture, t);
foreach_widget(m, &slist_def_utop_cols, installtexture, t);
+ }
+ /* unfocused background texture */
+ if ((t = load_texture(m, "uxterior.img")))
+ {
+ foreach_widget(m, &def_utop_cols, installtexture, t);
+ foreach_widget(m, &slist_def_utop_cols, installtexture, t);
#endif
}
#if 0
Theme relate functions
The seems to be the beginnings of a "themes engine", referred to in the code as
"theme modules". The code also implies that a binary module is talked too..
Most of these functions are in WIN_DRAW.C. Functions are listed in order found.
Dynamic gradient changing will require new functions. External access to certain
functions would be useful, either XA_AES protocol, or gemscript, or struct in
shared memeory.
For other gradient structs, see RENDER_OBJ.C, whiled the "chiseled 3D look" is beneath those structs, starting at "Local helper functions".
I will aso look at generating UDO docs on XaAES - Paul
pixel format functions:
(in TRNFM.C, plus)
pix_2_sl
sl_2_pix
color functions:
(base colors and resources)
duplicate_theme
delete_theme
struct window_colours
struct window_colours def_otop_cols (focused)
struct window_colours def_utop_cols (unfocused)
ref_colortheme_resources
deref_colortheme_resources
cleanup_colortheme
gradient functions:
(related to use of color gradients)
struct xa_gradient otop_vslide_gradient (focused)
struct xa_gradient otop_hslide_gradient (focused)
struct xa_gradient otop_vslider_gradient (focused)
struct xa_gradient otop_hslider_gradient (focused)
struct xa_gradient utop_vslide_gradient (unfocused)
struct xa_gradient utop_hslide_gradient (unfocused)
struct xa_gradient utop_vslider_gradient (unfocused)
struct xa_gradient utop_hslider_gradient (unfocused)
struct xa_gradient otop_title_gradient (focused)
struct xa_gradient utop_title_gradient (unfocused)
struct xa_gradient otop_info_gradient (focused)
struct xa_gradient utop_info_gradient (unfocused)
struct xa_gradient otop_green_gradient (unused)
struct xa_gradient otop_grey_gradient (focused)
struct xa_gradient utop_grey_gradient (unfocused)
free_priv_gradients
find_gradient
window frame darwing functions:
(window frame "widgets")
draw_pu_canvas
draw_widg_box
draw_widget_text
draw_widg_icon
get_widg_gradient
set_widg_size
build_bfobspec
widget functions:
(related to window widgets)
get_wcol
set_wcol
fix_widg
fix_default_widgets
foreach_widget
delete_pmap
texturing functions:
(loading and specific assignment of textures)
set_texture
free_texture (unused)
delete_texture
load_texture
init_sliders
info_texture
title_texture
installtexture
test_img_stuff
module functions:
(beginnings of "AES theme modules")
init_module
exit_module
new_theme
free_theme
delete_color_theme
new_color_theme
free_color_theme
struct xa_module_widget_theme module
exit_module
main_xa_theme
Textures:
Current CVS (20091128) texture list and "new" extensions. Add "v" to begining of
filename for "vertical" and "u" to end for "unfocused" except where the 8.3 file
format would be broken, then replace first character with "u". New textures can
incrementally replace old ones. ie one texture for slider, indivudual textures for
unfocused slider and vslider. See "Extended basic texturing" and "init sliders"
for logical ordering of image loading.
| original file | where | with focus | unfocused | new file |
---------------------------------------------------------------------------------
slwtitle.img File Selector Title slwtitle ulwtitle ulwtitle.img
wtitle.img Window Title wtitle wtitleu wtitleu.img
slider.img Scrollbar Slider slider slideru slideru.img
slide.img Scrollbar background slide slideu slideu.img
Vertical Slider vslider vslideru vslider.img
Vertical Slider vslideru vslideru.img
Vertical background vslide vslideu vslide.img
Vertical background vslideu vslideu.img
info.img Info Area Background info infou infou.img
exterior.img Base Window Frame BG exterior uxterior uxterior.img
--- cvs-src.km/win_draw.c 2010-01-12 04:57:49.000000000 +1100
+++ src.km/win_draw.c 2010-01-12 05:09:25.000000000 +1100
@@ -3779,6 +3779,65 @@
set_texture(m, &def_utop_cols.hslide, t);
}
#endif
+
+ /* allow seperate slider textures */
+ if ((t = load_texture(m, "vslider.img")))
+ {
+ set_texture(m, &def_otop_cols.vslider, t);
+ set_texture(m, &def_utop_cols.vslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_otop_cols.vslider, t);
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "vslide.img")))
+ {
+ set_texture(m, &def_otop_cols.vslide, t);
+ set_texture(m, &def_utop_cols.vslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_otop_cols.vslide, t);
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+#endif
+ }
+
+ /* allow seperate unfocused textures */
+ if ((t = load_texture(m, "slideru.img")))
+ {
+ set_texture(m, &def_utop_cols.vslider, t);
+ set_texture(m, &def_utop_cols.hslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+ set_texture(m, &slist_def_utop_cols.hslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "slideu.img")))
+ {
+ set_texture(m, &def_utop_cols.vslide, t);
+ set_texture(m, &def_utop_cols.hslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+ set_texture(m, &slist_def_utop_cols.hslide, t);
+#endif
+ }
+
+ /* allow seperate unfocused slider textures */
+ if ((t = load_texture(m, "vslideru.img")))
+ {
+ set_texture(m, &def_utop_cols.vslider, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslider, t);
+#endif
+ }
+
+ if ((t = load_texture(m, "vslideu.img")))
+ {
+ set_texture(m, &def_utop_cols.vslide, t);
+#ifndef ST_ONLY
+ set_texture(m, &slist_def_utop_cols.vslide, t);
+#endif
+ }
}
static void
@@ -3786,31 +3845,54 @@
{
struct widg_texture *t;
+ /* info bar */
if ((t = load_texture(m, "info.img"))) //"lgrey008.img")))
{
set_texture(m, &def_otop_cols.info, t);
set_texture(m, &def_utop_cols.info, t);
}
+
+ /* unfocused info bar */
+ if ((t = load_texture(m, "infou.img")))
+ {
+ set_texture(m, &def_utop_cols.info, t);
+ }
}
static void
title_texture(struct module *m)
{
struct widg_texture *t;
+ /* window bar */
t = load_texture(m, "wtitle.img");
-
if (t) //((t = load_texture(m, "wtitle.img")))
{
set_texture(m, &def_otop_cols.title, t);
set_texture(m, &def_utop_cols.title, t);
}
+
+ /* unfocused window bar */
+ t = load_texture(m, "wtitleu.img");
+ if (t) //((t = load_texture(m, "wtitle.img")))
+ {
+ set_texture(m, &def_utop_cols.title, t);
+ }
+
#ifndef ST_ONLY
+ /* fileselector bar */
t = load_texture(m, "slwtitle.img");
if (t)
{
set_texture(m, &slist_def_otop_cols.title, t);
set_texture(m, &slist_def_utop_cols.title, t);
}
+
+ /* unfocused fileselector bar */
+ t = load_texture(m, "ulwtitle.img");
+ if (t)
+ {
+ set_texture(m, &slist_def_utop_cols.title, t);
+ }
#endif
}
@@ -3831,6 +3913,7 @@
info_texture(m);
title_texture(m);
+ /* background texture */
if ((t = load_texture(m, "exterior.img"))) //grey8b.img")))
{
// foreach_widget(struct module *m, struct window_colours *wc, void(*f)(struct xa_wcol_inf *wci, void *d), void *parms)
@@ -3839,6 +3922,12 @@
#ifndef ST_ONLY
foreach_widget(m, &slist_def_otop_cols, installtexture, t);
foreach_widget(m, &slist_def_utop_cols, installtexture, t);
+ }
+ /* unfocused background texture */
+ if ((t = load_texture(m, "uxterior.img")))
+ {
+ foreach_widget(m, &def_utop_cols, installtexture, t);
+ foreach_widget(m, &slist_def_utop_cols, installtexture, t);
#endif
}
#if 0