void fileOpenCb(Widget w, XEvent *event, String *params, Cardinal *num_params) { FileWindowRec *fw; FileRec *file; int item; char path[MAXPATHLEN]; String *argv, push_action; if (!(fw = findFileWidget(w, &item))) return; zzz(); file = fw->files[item]; strcpy(path, fw->directory); if (path[strlen(path)-1] != '/') strcat(path, "/"); strcat(path, file->name); if (S_ISDIR(file->stats.st_mode)) { contractPath(path); chFileDir(fw, path); } else if (file->stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) { String arguments = XtNewString(file->name); String action = (String) XtMalloc((strlen(path) + 6) * sizeof(char)); strcat(strcpy(action, "exec "), path); argv = makeArgv(action, 1, &arguments); executeApplication(user.shell, fw->directory, argv); XTFREE(action); freeArgv(argv); } else if (file->type) { if (*(push_action = file->type->push_action)) { if (!(strcmp(push_action, "EDIT"))) doEdit(fw->directory, file->name); else if (!(strcmp(push_action, "VIEW"))) doView(fw->directory, file->name); else if (!(strcmp(push_action, "LOAD"))) { zzz(); newApplicationWindow(path, NULL); wakeUp(); } else { argv = (String *) XtMalloc(sizeof(String)); argv[0] = XtNewString(file->name); performAction(fw->shell, file->type->icon_pm.bm, push_action, fw->directory, 1, argv); XTFREE(argv); } } } else doEdit(fw->directory, file->name); wakeUp(); }
/*---------------------------------------------------------------------------*/ void fileExecAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { int i; FileWindowRec *fw; char **argv; i = findWidget(w, &fw); if (i == -1 || !fw) { /* error("Internal error:","widget not found in fileExecAction"); */ return; } if (fw->files[i]->type) { if (*fw->files[i]->type->push_action) if (!strcmp(fw->files[i]->type->push_action, "EDIT")) doEdit(fw->directory, fw->files[i]->name); else if (!strcmp(fw->files[i]->type->push_action, "VIEW")) doView(fw->directory, fw->files[i]->name); else if (!strcmp(fw->files[i]->type->push_action, "IMAGE")) doImage(fw->directory, fw->files[i]->name); else if (!strcmp(fw->files[i]->type->push_action, "SIAGHELP")) doSiaghelp(fw->directory, fw->files[i]->name); else { int k = 0; char *action = varPopup(fw->files[i]->type->icon_bm, fw->files[i]->type->push_action); if (!action) return; argv = (char **) XtMalloc( (user.arg0flag ? 6 : 5) * sizeof(char *)); argv[k++] = user.shell; argv[k++] = "-c"; argv[k++] = action; if (user.arg0flag) argv[k++] = user.shell; argv[k++] = fw->files[i]->name; argv[k] = NULL; executeApplication(user.shell, fw->directory, argv); XTFREE(argv); } } else doEdit(fw->directory, fw->files[i]->name); }
void NewGame::onKeyDown(Event::Keyboard* event) { switch (event->keyCode()) { case SDLK_ESCAPE: case SDLK_b: doBack(); break; case SDLK_t: doBeginGame(); break; case SDLK_c: doCreate(); break; case SDLK_m: doEdit(); break; case SDLK_LEFT: doPrev(); break; case SDLK_RIGHT: doNext(); break; } }
void fileEditCb(Widget w, XtPointer client_data, XtPointer call_data) { FileWindowRec *fw = (FileWindowRec *) client_data; int item; XtVaGetValues(fw->form, XmNuserData, (XtPointer) &item, NULL); doEdit(fw->directory, fw->files[item]->name); }
static void iconFileEditCb(Widget w, XtPointer client_data, XtPointer call_data) { AppRec *app = &((DTIconRec *) client_data)->app; char path[MAXPATHLEN]; if (app->directory[0]) { strcpy(path, app->directory); fnexpand(path); } else strcpy(path, user.home); doEdit(path, app->fname); }
void NewGame::onEditButtonClick(Event::Mouse* event) { doEdit(); }
void __fastcall TSettingBundleFrame::BundleEditClick( TObject *Sender ) { doEdit( Sender ); }
void editFileMonCb(Widget w, XtPointer client_data, XtPointer calldata) { zzz(); doEdit(resources.appcfg_path, resources.mon_file); wakeUp(); }