Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
56 user(s) are online (33 user(s) are browsing Forums)

Members: 0
Guests: 56

more...

Headlines

Forum Index


Board index » All Posts (centaurz)




Docky example
Just popping in
Just popping in


Hi,

Since the AmigaOS documentation wiki is referring to it, I recently uploaded the latest source code of winbar.docky on OS4depot. This can be helpful for such things as adding context menus, firing requests to AmiDock or other of the many still undocumented features of the API.

One thing I forgot to tell on OS4depot is where to find prefsobjects_macro.h include file which is required: the file can be downloaded from OpenAmiga.org.

Go to top


Re: fdtrans, 68k->ppc cross-call stubs generation
Just popping in
Just popping in


@kas1e

1. If I got it right, you're in the situation of legacy 68k code calling a native library through a 68k jump table and emulation traps. Native code is not aware of emulated A6 register, it only requires an interface pointer as first parameter (Self) so I don't see any problem.

I think you are mixing up with the glue code which wrap 68k library calls from native code.

2. This first line is used to retrieve a pointer to the libbase (which is not used directly by ppc code).

Go to top


Re: I.... hate AmiDock...!
Just popping in
Just popping in


@alfkil

You are notified about the task/bit to signal through DOCKYSET_DockyAttention (I would store it in the library base for an easy access by the main program).
When your program signals AmïDock, every docky is sent the DOCKYGET_NeedsAttention message, so it is a good idea to use a flag to know if the notification really comes from your program.

@trixie

Given how it works, AmiDock is not meant for Intuition gadgets at all, but for animated contents.


Go to top


Re: I.... hate AmiDock...!
Just popping in
Just popping in


@alfkil

Quote:

there is no way to trigger a redraw from outside the docky


Use DOCKYGET_NeedsAttention for this. This is how a docky can be notified from an external task by signaling AmiDock process. Quite straightforward, this is how e.g. winbar is told to rethink its layout in response to a change in preferences, or Intuition windows list. A shared structure and a semaphore/mutex to protect the data.

IMHO the docky API is not too bad, the problem is the documentation was never finished.

Go to top


Re: How to use Alpha layer for Docky ?
Just popping in
Just popping in


@zzd10h
Quote:

Edit : Is somebody knows if it's possible to add a Docky to AmiUpdate ?
Because, unlike a normal application, APPDIR:NetDock doesn't work.
Thank you


Yes, define the following function (AFAIR this is the example provided on AmiUpdate website) :

Quote:

/**********************************************************
**
** The following function saves the variable name passed in
** 'varname' to the ENV(ARC) system so that the application
** can become AmiUpdate aware.
**
**********************************************************/
static void SetAmiUpdateENVVariable(CONST_STRPTR varname, CONST_STRPTR progpath )
{
/* AmiUpdate support code */
APTR oldwin = NULL;
TEXT varpath[1024] = "AppPaths";

/* stop any "Insert volume..." type requesters */
oldwin = IDOS->SetProcWindow((APTR)-1);

/*
finally set the variable to the
path the executable was run from
don't forget to supply the variable
name to suit your application
*/

IDOS->AddPart( varpath, varname, 1024);
IDOS->SetVar( varpath, progpath, -1, GVF_GLOBAL_ONLY|GVF_SAVE_VAR );

/* turn requesters back on */
IDOS->SetProcWindow( oldwin );

}


and call it when AmiDock tells you about the location of the docky library (removing the file name) :
Quote:

case DOCKYSET_FileName:
{
char buffer[LARGE_BUFFER];

IUtility->Strlcpy(buffer, (STRPTR)msgData, LARGE_BUFFER);
*(IDOS->FilePart(buffer)) = '\0';
SetAmiUpdateENVVariable("NetDock", buffer);

break;
}


Then you just need to tell AmiUpdate the name of the env var to check (here : NetDock)

Go to top


Re: How to use Alpha layer for Docky ?
Just popping in
Just popping in


Hi,

On non-composited screens, AmiDock uses a "fake" transparency effect (i.e. the bitmap is filled with the contents of the window behind the dock), meaning that you can only add things over the background but you cannot render half or totally transparent contents without doing the blending at the same time (or you'll lose background information).

So if you want to support this configuration you need to follow this rule or provide an alternate rendering if you want to do fancy stuff when compositing is enabled.

Now, what you are trying to do should work on composited screens, but you have to tell AmiDock that you are using composited mode (see DOCKYGET_SupportsComposite and DOCKYGET_CompositeMode) so that it does not try to de-multiply the docky bitmap. Also I'm not sure you can use legacy pens to fill alpha channel, you're better off with direct ARGB painting (see SetRPAttrs() with RPTAG_APenColor).

Go to top


Re: Docky example
Just popping in
Just popping in


@alfkil

In case you wondered where that contextMenu pointer came from, I'v just added the missing declaration in the code sample above .

Go to top


Re: Docky example
Just popping in
Just popping in


@alfkil

Context menus are dynamically built in response to DOCKYGET_ContextMenu attribute :

BOOL DockyGet (struct DockyIFace *Selfuint32 msgTypeuint32 *msgData)
{
switch (
msgType)
{
/* ... */

case DOCKYGET_ContextMenu:
{
Object *contextMenu = (Object *)msgData;

Object *item1 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_PREFS),
        
PMIA_IDPMID_PREFS,
    
PopupMenuItemEnd;

    
Object *item2 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_SAVEASDEFAULT),
        
PMIA_IDPMID_SAVEASDEFAULT,
    
PopupMenuItemEnd;

    
Object *item3 PopupMenuItemObject,
        
PMIA_TitleGetString(&liLOCALE_ITEM_USEASDEFAULT),
        
PMIA_IDPMID_USEASDEFAULT,
    
PopupMenuItemEnd;

if (
item1 && item2 && item3)
    {
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem1);
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem2);
        
IIntuition->IDoMethod(contextMenuOM_ADDMEMBERitem3);
    }

}
break;

/* ... */

}


Edited by centaurz on 2013/1/23 21:35:41
Go to top


Re: DSI error at exit
Just popping in
Just popping in


@freddix

It looks like you are passing a NULL pointer to some function from minigl.library in DEDeleteImage() (the cause of the DSI is an access to 0x00000020). Now you have to find out why.

Go to top


Re: DSI error at exit
Just popping in
Just popping in


@freddix

A crashlog could help. If the DSI is within your code at least you'll know the reason of the crash.

Go to top


Re: Obtain mp3 info?
Just popping in
Just popping in


@Antique

Maybe you should declare and open the library ?

Quote:

struct MpegaIFace IMpega = NULL;
struct Library *MPEGABase = NULL;

/* ... */

MPEGABase = OpenLibrary("mpega.library", 0);

IMpega = (struct MpegaIFace *)GetInterface(MPEGABase, "main", 1, NULL);



Edit: Salass00 faster + fixed libbase name

Go to top


Re: Interrupts across a PCI Bridge
Just popping in
Just popping in


Hi,

I found this link which might be helpful, though probably covering some x86-specific rules.
At the beginning of the article, there seems to be a mapping applicable to PCI boards with an integrated bridge.

Go to top


Re: Frontmost pubscreen?
Just popping in
Just popping in


@Deniil

You mean a straightforward and elegant way of accessing information . No need for weird accessor such as IIntuition->GiveMeFrontmostScreenPlease().

Go to top


Re: Frontmost pubscreen?
Just popping in
Just popping in


IntuitionBase->FirstScreen (better lock IBase while you read it).

Go to top


Re: Application Suggestion for willing Developer
Just popping in
Just popping in


@angelheart

Because there's already a drawer for this purpose, it's called S: (for Scripts). C: is for Commands. Why reinvent the wheel ?

Go to top


Re: Get WB params without using main() ?
Just popping in
Just popping in


@jaokim

You won't catch a lot of WB programs by patching System().

Go to top


Re: How to manually initialize a bitmap
Just popping in
Just popping in


@TSK
Quote:

Quote from Autodocs for SetRPAttrs() and RPTAG_APenColor: "The alpha part is currently ignored and should be set to 0xFF".

So it looks like no chance at the moment.


This part of the autodoc actually needs an update. Of course you can render into the alpha channel of an ARGB bitmap. What is written here only applies to bitmaps that are meant for display (a window, a screen, a backbuffer...).

Go to top


Re: Utilities/Find
Just popping in
Just popping in


@djrikki

No, it's a feature introduced by SFS and supported by JXFS as well. FFS partitions don't have such a directory for example.

Go to top


Re: Moving windows
Just popping in
Just popping in


@Antique

What do you mean by 'moving' ? Simple translation or resizing ?

Go to top


Re: Sane native?
Just popping in
Just popping in


@Mrodfr

So there's someone working on the port, that's fine .

Go to top



TopTop
(1) 2 3 4 ... 7 »




Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project