Example #1
0
BOOL initBrowserEditWinClass(void)
{
    BOOL success = FALSE;

    ENTER();

    if((g_browserEditWinClass = MUI_CreateCustomClass(NULL, MUIC_Window, NULL, sizeof(struct data), ENTRY(dispatcher))) != NULL)
    {
        localizeStrings(names);
        success = TRUE;
    }

    RETURN(success);
    return success;
}
Example #2
0
int main()
{
    initStrings();

    localizeStrings(PageLabels);

    localizeNewMenu(menu);

    if(!(OpenURLBase = IExec->OpenLibrary(OPENURLNAME, OPENURLVER)))
         return -1;
    if(!(IOpenURL = (struct OpenURLIFace*)IExec->GetInterface(OpenURLBase, "main", 1L, NULL)))
        return -1;

    RA_SetUpHook(idcmphook, IDCMPFunc, NULL);

    if((AppPort = IExec->AllocSysObjectTags(ASOT_PORT, TAG_DONE)) != NULL)
    {
        IExec->NewList(&list_Brow);
        IExec->NewList(&list_Mail);
        IExec->NewList(&list_FTPs);

        win = make_window();
        edit_brow_win = make_edit_brow_win();
        edit_mail_win = make_edit_mail_win();
        edit_ftp_win = make_edit_ftp_win();

        loadPrefs(URL_GetPrefs_Mode_InUse);

        // Set up inter-group label alignment

        iset(OBJ(OBJ_FTP_ALIGN1), LAYOUT_AlignLabels, OBJ(OBJ_FTP_ALIGN2));
        iset(OBJ(OBJ_MAIL_ALIGN1), LAYOUT_AlignLabels, OBJ(OBJ_MAIL_ALIGN2));
        iset(OBJ(OBJ_LBROWSER_BROW), ICA_TARGET, OBJ(OBJ_EDIT_BROW),
                                     ICA_MAP,    lst2btn);

        if((window = RA_OpenWindow(win)) != NULL)
        {
            uint32 sigmask;
            BOOL done = FALSE;

            sigmask = iget(win, WINDOW_SigMask);
            while (!done)
            {
                uint32 siggot;

                siggot = IExec->Wait(sigmask);
                if (siggot & sigmask)
                {
                    done = HandleInput_Main_Win();
                    HandleInput_Edit_Brow_Win();
                    HandleInput_Edit_Mail_Win();
                    HandleInput_Edit_FTP_Win();
                }
            }
        }
        IIntuition->DisposeObject(edit_ftp_win);
        IIntuition->DisposeObject(edit_mail_win);
        IIntuition->DisposeObject(edit_brow_win);
        IIntuition->DisposeObject(win);

        //  The hidden chooser isn't attached to anything,
        //  so we must dispose of it ourselves...

        IIntuition->DisposeObject(OBJ(OBJ_HIDDEN_CHOOSER));

        IListBrowser->FreeListBrowserList(&list_FTPs);
        IListBrowser->FreeListBrowserList(&list_Mail);
        IListBrowser->FreeListBrowserList(&list_Brow);
        IExec->FreeSysObject(ASOT_PORT, AppPort);
    }

    IExec->DropInterface((struct Interface*)IOpenURL);
    IExec->CloseLibrary(OpenURLBase);

    uninitStrings();

    return 0;
}