1 #include <libraries/mui.h>
2 #include <zune/customclasses.h>
4 #include <proto/alib.h>
5 #include <proto/intuition.h>
6 #include <proto/utility.h>
13 struct ListviewEntry
*keymap
;
14 char buf
[KEYMAP_NAME_LEN
+ KEYMAP_FLAG_LEN
];
17 static IPTR
Keymap__OM_NEW(Class
*cl
, Object
*obj
, struct opSet
*msg
)
19 obj
= (Object
*)DoSuperNewTags(cl
, obj
, NULL
,
21 MUIA_Background
, MUII_TextBack
,
22 MUIA_Group_Horiz
, TRUE
,
23 TAG_MORE
, msg
->ops_AttrList
29 static IPTR
Keymap__OM_SET(Class
*cl
, Object
*obj
, struct opSet
*msg
)
31 struct Keymap_DATA
*data
= INST_DATA(cl
, obj
);
32 struct TagItem
*tags
= msg
->ops_AttrList
;
35 while ((tag
= NextTagItem(&tags
)) != NULL
)
39 case MUIA_Keymap_Keymap
:
40 data
->keymap
= (struct ListviewEntry
*)tag
->ti_Data
;
45 if (data
->keymap
->displayflag
)
47 unsigned int len
= strlen(data
->keymap
->displayflag
);
49 CopyMem(data
->keymap
->displayflag
, data
->buf
, len
);
50 dst
= data
->buf
+ len
;
56 strcpy(dst
, data
->keymap
->node
.ln_Name
);
61 SET(obj
, MUIA_Text_Contents
, data
->buf
);
66 return DoSuperMethodA(cl
, obj
, (Msg
)msg
);
69 IPTR
Keymap__OM_GET(Class
*cl
, Object
*obj
, struct opGet
*msg
)
71 struct Keymap_DATA
*data
= INST_DATA(cl
, obj
);
73 switch (msg
->opg_AttrID
)
75 case MUIA_Keymap_Keymap
:
76 *msg
->opg_Storage
= (IPTR
)data
->keymap
;
80 return DoSuperMethodA(cl
, obj
, (Msg
)msg
);
85 Keymap
, NULL
, MUIC_Text
, NULL
,
86 OM_NEW
, struct opSet
*,
87 OM_SET
, struct opSet
*,
88 OM_GET
, struct opGet
*