Beispiel #1
0
/// HandleInput_Edit_FTP_Win
void HandleInput_Edit_FTP_Win()
{
    uint32 result      = 0;
    uint16 code        = 0;

    while ((result = RA_HandleInput(edit_ftp_win, &code)))
    {
        switch(result & WMHI_CLASSMASK)
        {
            case WMHI_CLOSEWINDOW:
                RA_CloseWindow(edit_ftp_win);
                edit_ftp_window = NULL;
                break;
            case WMHI_GADGETUP:
                switch (result & WMHI_GADGETMASK)
                {
                    case OBJ_FTP_USE:
                        gadset(GAD(OBJ_LBROWSER_BROW), window, LISTBROWSER_Labels, ~0);
                        updateFTPNode();
                        gadset(GAD(OBJ_LBROWSER_BROW), window, LISTBROWSER_Labels, &list_FTPs,
                                                               LISTBROWSER_AutoFit, TRUE);
                    case OBJ_FTP_CANCEL:
                        RA_CloseWindow(edit_ftp_win);
                        edit_brow_window = NULL;
                        break;
                    case OBJ_FTP_PATH_GET:
                        if (gfRequestFile(OBJ(OBJ_FTP_PATH_GET), edit_ftp_window))
                        {
                        }
                        break;
                    case OBJ_FTP_PATH_CHOOSE:  // set Attrs according to the button clicked on.
                    case OBJ_FTP_OPEN_CHOOSE:
                    case OBJ_FTP_NEW_CHOOSE:
                        iset( OBJ(OBJ_HIDDEN_CHOOSER), CHOOSER_LabelArray, hidden_strings);
                        IIntuition->ActivateGadget(GAD(OBJ_HIDDEN_CHOOSER),
                                                   edit_ftp_window, NULL);
                        break;
                    case OBJ_FTP_AREXX_CHOOSE:
                        iset( OBJ(OBJ_HIDDEN_CHOOSER), CHOOSER_LabelArray, hidden_strings);
                        IIntuition->ActivateGadget(GAD(OBJ_HIDDEN_CHOOSER),
                                                   edit_ftp_window, NULL);
                        break;
                }
        }
    }
}
Beispiel #2
0
void updateBrowserNode()
{
    struct URL_BrowserNode *pBrowser;

    if((pBrowser = (struct URL_BrowserNode *)iget(edit_brow_win, WINDOW_UserData)) != NULL)
    {
        STRPTR strValue;

        strValue = (STRPTR)iget(GAD(OBJ_BROW_NAME_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_Name, strValue, sizeof(pBrowser->ubn_Name));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_PATH_GET), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_Path, strValue, sizeof(pBrowser->ubn_Path));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_AREXX_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_Port, strValue, sizeof(pBrowser->ubn_Port));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_SHOW_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_ShowCmd, strValue, sizeof(pBrowser->ubn_ShowCmd));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_FRONT_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_ToFrontCmd, strValue, sizeof(pBrowser->ubn_ToFrontCmd));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_OPEN_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_OpenURLCmd, strValue, sizeof(pBrowser->ubn_OpenURLCmd));
        strValue = (STRPTR)iget(GAD(OBJ_BROW_NEW_STR), STRINGA_TextVal);
        IUtility->Strlcpy(pBrowser->ubn_OpenURLWCmd, strValue, sizeof(pBrowser->ubn_OpenURLWCmd));

        // now update the ListBrowser attributes
        IListBrowser->SetListBrowserNodeAttrs((struct Node*)pBrowser,  LBNA_Column,    1,
                                               LBNCA_Text,             pBrowser->ubn_Name,
                                               LBNA_Column,            2,
                                               LBNCA_Text,             pBrowser->ubn_Path,
                                               TAG_END);
    }
}
Beispiel #3
0
void updateMailerNode()
{
    struct URL_MailerNode * pMailer = NULL;

    IIntuition->GetAttr( WINDOW_UserData, edit_mail_win, (ULONG*)&pMailer );
    if( pMailer )
    {
        STRPTR strValue = NULL;
        IIntuition->GetAttr(STRINGA_TextVal, GAD(OBJ_MAIL_NAME_STR), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_Name, strValue, NAME_LEN );
        IIntuition->GetAttr(GETFILE_File, GAD(OBJ_MAIL_PATH_GET), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_Path, strValue, PATH_LEN );
        IIntuition->GetAttr(STRINGA_TextVal, GAD(OBJ_MAIL_AREXX_STR), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_Port, strValue, PORT_LEN );
        IIntuition->GetAttr(STRINGA_TextVal, GAD(OBJ_MAIL_SHOW_STR), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_ShowCmd, strValue, SHOWCMD_LEN );
        IIntuition->GetAttr(STRINGA_TextVal, GAD(OBJ_MAIL_FRONT_STR), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_ToFrontCmd, strValue, TOFRONTCMD_LEN );
        IIntuition->GetAttr(STRINGA_TextVal, GAD(OBJ_MAIL_WRITE_STR), (ULONG*)&strValue );
        IUtility->Strlcpy( pMailer->umn_WriteMailCmd, strValue, WRITEMAILCMD_LEN );

        // now update the ListBrowser attributes
        IListBrowser->SetListBrowserNodeAttrs( (struct Node*)pMailer,   LBNA_Column,    1,
                                                LBNCA_Text,             pMailer->umn_Name,
                                                LBNA_Column,            2,
                                                LBNCA_Text,             pMailer->umn_Path,
                                                TAG_END );
    }
}
Beispiel #4
0
void updateFTPWindow(struct URL_FTPNode  * pFTP)
{
    if(pFTP != NULL)
    {
        gadset(GAD(OBJ_FTP_NAME_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_Name);
        gadset(GAD(OBJ_FTP_PATH_GET), edit_ftp_window, GETFILE_File, pFTP->ufn_Path);
        gadset(GAD(OBJ_FTP_AREXX_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_Port);
        gadset(GAD(OBJ_FTP_REMOVE), edit_ftp_window, GA_Selected, isFlagSet(pFTP->ufn_Flags, UFNF_REMOVEFTP));
        gadset(GAD(OBJ_FTP_SHOW_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_ShowCmd);
        gadset(GAD(OBJ_FTP_FRONT_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_ToFrontCmd);
        gadset(GAD(OBJ_FTP_OPEN_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_OpenURLCmd);
        gadset(GAD(OBJ_FTP_NEW_STR), edit_ftp_window, STRINGA_TextVal, pFTP->ufn_OpenURLWCmd);
    }
}
Beispiel #5
0
void updateBrowserWindow(struct URL_BrowserNode  * pBrowser)
{
    if(pBrowser != NULL)
    {
        iset(edit_brow_win,  WINDOW_UserData, pBrowser);
        gadset(GAD(OBJ_BROW_NAME_STR), edit_brow_window, STRINGA_TextVal, pBrowser->ubn_Name);
        gadset(GAD(OBJ_BROW_PATH_GET), edit_brow_window, GETFILE_File, pBrowser->ubn_Path);
        gadset(GAD(OBJ_BROW_AREXX_STR), edit_brow_window, STRINGA_TextVal, pBrowser->ubn_Port);
        gadset(GAD(OBJ_BROW_SHOW_STR), edit_brow_window,  STRINGA_TextVal, pBrowser->ubn_ShowCmd);
        gadset(GAD(OBJ_BROW_FRONT_STR), edit_brow_window, STRINGA_TextVal, pBrowser->ubn_ToFrontCmd);
        gadset(GAD(OBJ_BROW_OPEN_STR), edit_brow_window, STRINGA_TextVal, pBrowser->ubn_OpenURLCmd);
        gadset(GAD(OBJ_BROW_NEW_STR), edit_brow_window, STRINGA_TextVal, pBrowser->ubn_OpenURLWCmd);
    } else
    	IDOS->Printf("No browser node\n");
}
Beispiel #6
0
void updateMailerWindow( struct URL_MailerNode  * pMailer )
{
    if( pMailer )
    {
        IIntuition->SetAttrs(edit_mail_win,  WINDOW_UserData, pMailer, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_NAME_STR), edit_mail_window, NULL, STRINGA_TextVal, pMailer->umn_Name, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_PATH_GET), edit_mail_window, NULL, GETFILE_File, pMailer->umn_Path, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_AREXX_STR), edit_mail_window, NULL, STRINGA_TextVal, pMailer->umn_Port, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_SHOW_STR), edit_mail_window, NULL, STRINGA_TextVal, pMailer->umn_ShowCmd, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_FRONT_STR), edit_mail_window, NULL, STRINGA_TextVal, pMailer->umn_ToFrontCmd, TAG_DONE );
        IIntuition->SetGadgetAttrs(GAD(OBJ_MAIL_WRITE_STR), edit_mail_window, NULL, STRINGA_TextVal, pMailer->umn_WriteMailCmd, TAG_DONE );
    }
}
Beispiel #7
0
ULONG loadPrefs(ULONG mode)
{
    struct URL_Prefs       *p;
    ULONG                  error = 0;

    /* get the openurl.library prefs */
/*    switch(mode)
    {
        case MUIV_Win_GetPrefs_InUse:      mode = URL_GetPrefs_Mode_InUse;   break;
        case MUIV_Win_GetPrefs_LastSaveds: mode = URL_GetPrefs_Mode_Envarc;  break;
        case MUIV_Win_GetPrefs_Restore:    mode = URL_GetPrefs_Mode_Env;     break;
        case MUIV_Win_GetPrefs_Defaults:   mode = URL_GetPrefs_Mode_Default; break;
        default: return FALSE;
    }
*/
    p = IOpenURL->URL_GetPrefs(URL_GetPrefs_Mode,mode,TAG_DONE);
    if (!p) error = MSG_Err_NoPrefs;
    else if (p->up_Version!=PREFS_VERSION) error = MSG_Err_BadPrefs;

    if (error)
    {
        RA_Request(NULL,0,getString(MSG_ErrReqTitle),
                          getString(MSG_ErrReqGadget),
                          getString(error),
                          p ? p->up_Version : 0);

        if (p) IOpenURL->URL_FreePrefsA(p,NULL);

        return FALSE;
    }

    /* Browsers */
	gadset(GAD(OBJ_LBROWSER_BROW), window, LISTBROWSER_Labels, ~0);
    updateBrowserList(&list_Brow, p->up_BrowserList);
	gadset(GAD(OBJ_LBROWSER_BROW), window, LISTBROWSER_Labels, &list_Brow, LISTBROWSER_AutoFit, TRUE);

    /* Mailers */
    gadset(GAD(OBJ_LBROWSER_MAIL), window, LISTBROWSER_Labels, ~0, TAG_DONE);
    updateMailerList(&list_Mail, p->up_MailerList);
    gadset(GAD(OBJ_LBROWSER_MAIL), window, LISTBROWSER_Labels, &list_Mail, LISTBROWSER_AutoFit, TRUE);

    /* FTPs */
	gadset(GAD(OBJ_LBROWSER_FTP), window, LISTBROWSER_Labels, ~0, TAG_DONE);
    updateFTPList(&list_FTPs, p->up_FTPList);
	gadset(GAD(OBJ_LBROWSER_FTP), window, LISTBROWSER_Labels, &list_FTPs, LISTBROWSER_AutoFit, TRUE);

    /* Miscellaneous */
    gadset(GAD(OBJ_PREPEND), window, GA_Selected, isFlagSet(p->up_Flags, UPF_PREPENDHTTP));
    gadset(GAD(OBJ_SEND_MAILTO), window, GA_Selected, isFlagSet(p->up_Flags, UPF_DOMAILTO));
    gadset(GAD(OBJ_SEND_FTP), window, GA_Selected, isFlagSet(p->up_Flags, UPF_DOFTP));

    gadset(GAD(OBJ_UNICONIFY), window, GA_Selected, p->up_DefShow);
    gadset(GAD(OBJ_BRING), window, GA_Selected, p->up_DefBringToFront);
    gadset(GAD(OBJ_OPEN), window, GA_Selected, p->up_DefNewWindow);
    gadset(GAD(OBJ_LAUNCH), window, GA_Selected, p->up_DefLaunch);

    /* free the preferences */
    IOpenURL->URL_FreePrefsA(p,NULL);

    return TRUE;
}
Beispiel #8
0
///
/// HandleIDMCP
PERROR HandleIDCMP( FRAME *frame, struct Objects *o, struct Values *v, struct PPTBase *PPTBase )
{
    ULONG sig, sigmask, sigport = 0L;
    struct Library *ColorWheelBase = o->ColorWheelBase;
    struct IntuitionBase *IntuitionBase = PPTBase->lb_Intuition;
    BOOL V39 = FALSE;

    if( PPTBase->lb_Gfx->LibNode.lib_Version >= 39 && ColorWheelBase )
        V39 = TRUE;

    if(StartInput(frame, GINP_PICK_POINT, NULL) == PERR_OK)
        sigport = (1 << PPTBase->mport->mp_SigBit);

    GetAttr( WINDOW_SigMask, o->Win, &sigmask );
    for(;;) {

        sig = Wait( sigport|sigmask|SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_F );

        if( sig & SIGBREAKF_CTRL_C ) {
            SetErrorCode( frame, PERR_BREAK );
            DisposeObject( o->Win );
            StopInput(frame);
            return PERR_BREAK;
        }

        if( sig & SIGBREAKF_CTRL_F ) {
            WindowToFront( o->win );
            ActivateWindow( o->win );
        }

        if( sig & sigport ) {
            struct gPointMessage *gp;

            gp = (struct gPointMessage*)GetMsg(PPTBase->mport);

            /*
             *  Ignore all other types of messages, except pickpoints.
             */

            if( gp->msg.code == PPTMSG_PICK_POINT ) {
                D(bug("User picked point (%d,%d)\n",gp->x,gp->y));

                if( frame->pix->colorspace == CS_RGB ) {
                    RGBPixel *cp;

                    cp = (RGBPixel *)GetPixelRow( frame, gp->y );
                    SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level, cp[gp->x].r, TAG_DONE );
                    SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level, cp[gp->x].g, TAG_DONE );
                    SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level, cp[gp->x].b, TAG_DONE );
                } else {
                    ARGBPixel *cp;

                    cp = (ARGBPixel *)GetPixelRow( frame, gp->y );
                    SetGadgetAttrs( GAD(o->Trans), o->win, NULL, SLIDER_Level, cp[gp->x].a, TAG_DONE );
                    SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level, cp[gp->x].r, TAG_DONE );
                    SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level, cp[gp->x].g, TAG_DONE );
                    SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level, cp[gp->x].b, TAG_DONE );
                }

                v->background = FALSE;
            }

            ReplyMsg( (struct Message *)gp );
        }

        if( sig & sigmask ) {
            ULONG rc, tmp;
            struct ColorWheelRGB rgb;
            struct ColorWheelHSB hsb;

            while(( rc = HandleEvent( o->Win )) != WMHI_NOMORE ) {
                switch(rc) {
                    case WMHI_CLOSEWINDOW:
                    case GID_CANCEL:
                        D(bug("User cancelled\n"));
                        SetErrorCode( frame, PERR_CANCELED );
                        DisposeObject( o->Win );
                        StopInput(frame);
                        return PERR_CANCELED;

                    /*
                     *  Can't happen if running under <V39, but let's be
                     *  sure anyway
                     */

                    case GID_GRADIENTSLIDER:
                        if( V39 ) {
                            GetAttr(GRAD_CurVal, o->RealGradient, &tmp);
                            // D(bug("New value: %d\n",tmp));
                            GetAttr( WHEEL_HSB, o->Wheel, (ULONG *)&hsb );
                            hsb.cw_Brightness = (0xFFFF - tmp) * 0x00010001;
                            ConvertHSBToRGB( &hsb, &rgb );
                            SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level, rgb.cw_Red>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level, rgb.cw_Green>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level, rgb.cw_Blue>>24, TAG_DONE );
                            v->background = FALSE;
                        }
                        break;

                    /*
                     *  Ditto
                     */

                    case GID_WHEEL:
                        if( V39 ) {
                            GetAttr( WHEEL_RGB, o->Wheel, (ULONG *) &rgb );
                            SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level, rgb.cw_Red>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level, rgb.cw_Green>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level, rgb.cw_Blue>>24, TAG_DONE );
                            v->background = FALSE;
                        }
                        break;

                    case GID_RED:
                        if( V39 ) {
                            GetAttr( SLIDER_Level, o->Red, (ULONG *)&tmp );
                            GetAttr( WHEEL_RGB, o->Wheel, (ULONG *) &rgb );
                            rgb.cw_Red = tmp * 0x01010101;
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            v->background = FALSE;
                        }
                        break;

                    case GID_GREEN:
                        if( V39 ) {
                            GetAttr( SLIDER_Level, o->Green, (ULONG *)&tmp );
                            GetAttr( WHEEL_RGB, o->Wheel, (ULONG *) &rgb );
                            rgb.cw_Green = tmp * 0x01010101;
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            v->background = FALSE;
                        }
                        break;

                    case GID_BLUE:
                        if( V39 ) {
                            GetAttr( SLIDER_Level, o->Blue, (ULONG *)&tmp );
                            GetAttr( WHEEL_RGB, o->Wheel, (ULONG *) &rgb );
                            rgb.cw_Blue = tmp * 0x01010101;
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            v->background = FALSE;
                        }
                        break;

                    case GID_BACKGROUND:
                        GetBackGround( frame, v, PPTBase );

                        if( V39 ) {
                            rgb.cw_Red   = v->r * 0x01010101;
                            rgb.cw_Green = v->g * 0x01010101;
                            rgb.cw_Blue  = v->b * 0x01010101;
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            DoMethod( o->Win, WM_REPORT_ID, GID_WHEEL, 0L ); // A bug in OS?
                        } else {
                            SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level,v->r, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level,v->g, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level,v->b, TAG_DONE );
                        }

                        break;

                    case GID_BLACK:
                        rgb.cw_Red = rgb.cw_Green = rgb.cw_Blue = 0L;
                        if( V39 ) {
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            DoMethod( o->Win, WM_REPORT_ID, GID_WHEEL, 0L ); // A bug in OS?
                        } else {
                            SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level,rgb.cw_Red>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level,rgb.cw_Green>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level,rgb.cw_Blue>>24, TAG_DONE );
                        }
                        v->background = FALSE;
                        break;

                    case GID_WHITE:
                        rgb.cw_Red = rgb.cw_Green = rgb.cw_Blue = 0xFFFFFFFF;
                        if (V39 ) {
                            SetGadgetAttrs( GAD(o->Wheel), o->win, NULL, WHEEL_RGB, &rgb, TAG_DONE );
                            DoMethod( o->Win, WM_REPORT_ID, GID_WHEEL, 0L ); // A bug in OS?
                        } else {
                            SetGadgetAttrs( GAD(o->Red), o->win, NULL, SLIDER_Level,rgb.cw_Red>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Green), o->win, NULL, SLIDER_Level,rgb.cw_Green>>24, TAG_DONE );
                            SetGadgetAttrs( GAD(o->Blue), o->win, NULL, SLIDER_Level,rgb.cw_Blue>>24, TAG_DONE );
                        }
                        v->background = FALSE;
                        break;

                    case GID_OK:
                        D(bug("User hit OK\n"));
                        DoGadgets( frame, o, v, PPTBase );
                        GetAttr( WINDOW_Bounds, o->Win, (ULONG *)&v->window );
                        DisposeObject( o->Win );
                        StopInput(frame);
                        return PERR_OK;
                }
            }
        } /* if(sig&sigmask) */
    }