Who's Online
157 user(s) are online (
131 user(s) are browsing
Forums )
Members: 1
Guests: 156
samo79 ,
more...
Topic options
View mode
Newest First
How compile MUI based programms to AOS4 ?
Posted on:
2010/6/18 14:58
#1
Home away from home
Joined: 2007/9/11 12:31Last Login
: 11/19 7:43
From Russia
Group:
Registered Users
I have some aos3/aros/morphos related example, which i want port to aos4. So, i for first change all the includes on "proto/" (in case with mui, i add <proto/muimaster.h>, also i add #define __USE_INLINE__ 1 , but on linking stage i have tons of errors about "Reference to undefined symbol IMUIMaster".
I just do search for whole SDK on the "IMUIMaster" (for found correct lib.a to include), but found nothing.
First question is: have SDK by default any lib.a for mui , (like lubmui.a or libmuimaster.a), and if not have where get it.
And second one: I do no remember for now, need i open muimaster.library manually from code, or, just linking with right libmui.a will be enough ? For example for warp3d, i do that (when compile AOS3.x based progs):
Warp3DBase = OpenLibrary ( "Warp3D.library" , 2L );
#ifdef __amigaos4__
IWarp3D = ( struct Warp3DIFace *) GetInterface ( Warp3DBase , "main" , 1 , NULL );
if (! Warp3DBase && ! IWarp3D ) {
printf ( "Error opening Warp3D library\n" );
exit( 0 );
};
#endif
So should i do the same for Mui programms, and do OpenLibrary("muimaster.library") ?
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/18 15:16
#2
Quite a regular
Joined: 2006/12/2 0:35Last Login
: 1/19 10:37
From Sydney
Group:
Registered Users
@kas1e Yes, you have to open the library, then get the interface (the interface pointer is IMUIMaster). Something like: MUIBase = IExec->OpenLibrary ("MUI.library", 0); if (MUIBase == NULL) { error recovery/death } else IMUI = (struct MUIIFace *) IExec->GetInterface ( MUIBase, "main", 1, NULL);
cheers tony
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/18 15:25
#3
Home away from home
Joined: 2007/9/11 12:31Last Login
: 11/19 7:43
From Russia
Group:
Registered Users
@tonyw
I do it like that for now:
struct Library * MUIMasterBase ;
struct MUIMasterIFace * IMUIMaster ;
MUIMasterBase = OpenLibrary ( "muimaster.library" , 2L );
if (! MUIMasterBase ) {
printf ( "Error opening muimaster library\n" );
exit( 0 );
};
IMUIMaster = ( struct MUIMasterIFace *) GetInterface ( MUIMasterBase , "main" , 1 , NULL );
if (! MUIMasterBase && ! IMUIMaster ) {
printf ( "Error opening muimaster library\n" );
exit( 0 );
};
It is correct imho too ?
And one more question. Have this piece of code:
#define __USE_INLINE__ 1
#include <proto/muimaster.h>
APTR ImageButton ( CONST_STRPTR text , CONST_STRPTR image )
{
APTR obj , img ;
img = MUI_NewObject ( "Dtpic.mui" , MUIA_Dtpic_Name , image , TAG_DONE );
if ( text )
{
obj = VGroup ,
Child , HCenter ( img ),
Child , TextObject , text , MUIA_Text_PreParse , "\033c" , End ,
End ;
}
else
{
obj = img ;
}
return obj ;
}
And have "'MUIA_Dtpic_Name' undeclared". I do search for whole SDK on that , and found nothing. I need somethere download Dtpic class with some tdpic related includes ?
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/18 16:45
#4
Just popping in
Joined: 2007/5/15 13:42Last Login
: 2023/3/8 14:54
From Austria
Group:
Registered Users
@kas1e
It's part of MUI but not documented, you need
MUIUndoc from aminet.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/18 16:52
#5
Home away from home
Joined: 2007/9/11 12:31Last Login
: 11/19 7:43
From Russia
Group:
Registered Users
@Gazelle But its for 68k, no ? I found that for 68k and morphos, its defined as 0x80423d72. But that not works for aos4 (or i do something wrong in code)
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 11:17
#6
Quite a regular
Joined: 2006/12/2 0:35Last Login
: 1/19 10:37
From Sydney
Group:
Registered Users
@kas1e Your code segment (for opening the library and interface) looks OK, but in the part where the GetInterface fails and you "exit (0)", you must Close the libray first, don't exit and leave it open. I can't help you with MUI questions, I know nothing about it.
cheers tony
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 13:12
#7
Home away from home
Joined: 2006/11/20 16:26Last Login
: Yesterday 19:43
From Norway
Group:
Registered Users
@kas1e It's just a tag, remove it.
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 13:31
#8
Just popping in
Joined: 2008/11/20 20:09Last Login
: 2014/9/29 19:12
Group:
Registered Users
@LiveForIt If he removes the tag, he won't see much of the image. :) Anyway, it would berather weird if dtpic.mui wouldn't work the same way on OS4 as on 3.x or MorphOS.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 14:13
#9
Home away from home
Joined: 2007/9/11 12:31Last Login
: 11/19 7:43
From Russia
Group:
Registered Users
@Fab
Yep, indeed cant remove that. And it works the same way (cool :) ). The problem was because of that part of original code:
Child , ImageObject ,
MUIA_Image_Spec , ( uint32 ) "3:PROGDIR:data/draw.png" ,
MUIA_Frame , MUIV_Frame_None ,
End ,
That not works, and not attach buttons to. So, i replace it on that:
Child , MUI_NewObject ( "Dtpic.mui" ,
MUIA_Dtpic_Name , "PROGDIR:data/draw.png" ,
MUIA_Frame , MUIV_Frame_None ,
End ,
And it works. Strange why .. Still, have some problems related to MUI, and if you have some free time, check
that thread on UB.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 14:56
#10
Just can't stay away
Joined: 2009/4/28 4:57Last Login
: Yesterday 13:22
From Adelaide, Australia
Group:
Registered Users
@kas1e This is reminding me when I used to be "the guy" that made regular builds of YAM from the CVS tree, before the nightly builds existed. I used to make my own libmui.a, I think it was something like (using GeekGadgets on OS3 to do this): hunk2aout mui.lib ar q libmui.a obj#? Not sure if we have hunk2aout here? Then there's fd2pragma but I never used that.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 16:01
#11
Just popping in
Joined: 2007/5/15 13:42Last Login
: 2023/3/8 14:54
From Austria
Group:
Registered Users
@kas1e Take a look at the Autodocs for MUI_Image.doc: "3:<n>" where <n> is the name of an external boopsi image class. I think you need this: "5:<n>" where <n> is the name of an external picture file that should be loaded with datatypes. Kick 2.x users will get an empty image.
Re: How compile MUI based programms to AOS4 ?
Posted on:
2010/6/19 19:17
#12
Home away from home
Joined: 2007/9/11 12:31Last Login
: 11/19 7:43
From Russia
Group:
Registered Users
@Gazelle
That all strange, because it's not my code which i try to port. Its sources of aros paint program called LunaPaint. And it have exactly that stuff (3: and alt).
Maybe on AROS it must work like that .. Dunno, but that what i have with original source (with 3: and alt):
screenshot (you can see empty buttons).
And that (
screenshot ) how it looks like when i code on:
Child , MUI_NewObject ( "Dtpic.mui" ,
MUIA_Dtpic_Name , "PROGDIR:data/draw.png" ,
MUIA_Frame , MUIV_Frame_None ,
End ,
I think that background of buttons must be not black ..
Also, size of whole toolbar are wrong (but again, i change nothing in aros related source related to mui/strcuts/classes/size).
Mazze (who works on LunaPaint for now), say to me that this code:
Child , ImageObject ,
MUIA_Image_Spec , ( uint32 ) "3:PROGDIR:data/draw.png" ,
MUIA_Frame , MUIV_Frame_None ,
End ,
Would only work if ImageObject was a sub class of DtPic class. But that say for me nothing (and i change in code nothing related to mui). So, dunno why it not works originally.
Currently Active Users Viewing This Thread:
1
(
0 members
and 1 Anonymous Users
)