/* ingenmain.c * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information (NCBI) * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government do not place any restriction on its use or reproduction. * We would, however, appreciate having the NCBI and the author cited in * any work or product based on this material * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * =========================================================================== * * File Name: ingenmain.c * * Author: Fasika Aklilu * * Version Creation Date: 8/8/01 * * $Revision: 6.3 $ * * File Description: contains main function for ingenue * * Modifications: * -------------------------------------------------------------------------- * Date Name Description of modification * ------- ---------- ----------------------------------------------------- * * * ========================================================================== */ #include #include #include static char *date_of_compilation = __DATE__; static char *time_of_compilation = __TIME__; static void Ing_fromNetwork(ButtoN b) { IngGenomeViewerPtr igvp; WindoW hStart; hStart=ParentWindow(b); Hide(hStart); if (!(igvp=Ing_MainDataNew())) return; /* igvp->hProcess=Ing_ProcessingWindow(); */ Ing_GetFromNetwork(igvp, hStart); } static void Ing_CenterString (RectPtr rptr, CharPtr text, FonT fnt, Int2 inc) { if (fnt != NULL) { SelectFont (fnt); } rptr->bottom = rptr->top + LineHeight (); DrawString (rptr, text, 'c', FALSE); rptr->top = rptr->bottom + inc; } static void Ing_DrawAbout (PaneL p) { RecT r; Char str [60]; FonT titleFont=NULL; if (titleFont == NULL) { #ifdef WIN_MAC titleFont = GetFont ("Geneva", 18, TRUE, TRUE, FALSE, ""); #endif #ifdef WIN_MSWIN titleFont = GetFont ("Arial", 24, TRUE, TRUE, FALSE, ""); #endif #ifdef WIN_MOTIF titleFont = GetFont ("Courier", 24, TRUE, TRUE, FALSE, ""); #endif } sprintf (str, "Beta 1.05 [%s - %s]", date_of_compilation, time_of_compilation); ObjectRect (p, &r); InsetRect (&r, 4, 4); r.top += 10; Magenta (); Ing_CenterString (&r, " ~ Ingenue ~", titleFont, 5); /* Ing_CenterString (&r, str, programFont, 10); */ /* Ing_CenterString (&r, "National Center for Biotechnology Information", systemFont, 5); */ /* Ing_CenterString (&r, "National Library of Medicine", systemFont, 5); */ /* Ing_CenterString (&r, "National Institutes of Health", systemFont, 10); */ } static void Ing_quitProgram(ButtoN b) { QuitProgram(); } static void Ing_readExisting(ButtoN b) { IngGenomeViewerPtr igvp=NULL; WindoW hStart=NULL; hStart=ParentWindow(b); Hide(hStart); if (!(igvp=Ing_MainDataNew())) return; /* igvp->hProcess=Ing_ProcessingWindow(); */ Ing_FileOpenProc(igvp, hStart); } extern void Ing_StartupWindow(void) { WindoW hStart; GrouP c; PaneL p; hStart = FixedWindow (-50, -33l, -10, -10, "Welcome to INGENUE", StdCloseWindowProc); p = SimplePanel (hStart, 28 * stdCharWidth, 4 * stdLineHeight, Ing_DrawAbout); c = HiddenGroup (hStart, 1, 3, NULL); SetGroupMargins(c, 10, 10); SetGroupSpacing (c, 10, 10); PushButton (c, "Fetch from Entrez", Ing_fromNetwork); PushButton (c, "Open Local File", Ing_readExisting); PushButton (c, "Quit Program", Ing_quitProgram); AlignObjects (ALIGN_CENTER, (HANDLE) p, (HANDLE) c, NULL, NULL); Select(hStart); Show(hStart); ProcessEvents(); } static void Ing_SetupRegFuncs() { FeatDefPtr curr; Uint1 key; CharPtr label = NULL; Uint2 subtype; Char proclabel [64]; Char procname [64]; curr = FeatDefFindNext (NULL, &key, &label, FEATDEF_ANY, TRUE); while (curr != NULL) { if (key != FEATDEF_BAD && curr->seqfeat_key == SEQFEAT_IMP) { subtype = curr->featdef_key; if (subtype != FEATDEF_source) { sprintf (procname, "Edit %s", curr->menulabel); StringNCpy_0 (proclabel, curr->typelabel, sizeof (proclabel)); if (proclabel [0] == '-') { proclabel [0] = '~'; } REGISTER_IMPORT_EDIT(procname,proclabel,subtype); } } curr = FeatDefFindNext (curr, &key, &label, FEATDEF_ANY, TRUE); } curr = FeatDefFindNext (NULL, &key, &label, FEATDEF_ANY, TRUE); while (curr != NULL) { if (key != FEATDEF_BAD && curr->seqfeat_key == SEQFEAT_RNA) { subtype = curr->featdef_key; sprintf (procname, "Edit %s", curr->menulabel); StringNCpy_0 (proclabel, curr->typelabel, sizeof (proclabel)); if (proclabel [0] == '-') { proclabel [0] = '~'; } REGISTER_RNA_EDIT(procname,proclabel,subtype); } curr = FeatDefFindNext (curr, &key, &label, FEATDEF_ANY, TRUE); } curr = FeatDefFindNext (NULL, &key, &label, FEATDEF_ANY, TRUE); while (curr != NULL) { if (key != FEATDEF_BAD && curr->seqfeat_key == SEQFEAT_PROT) { subtype = curr->featdef_key; sprintf (procname, "Edit %s", curr->menulabel); StringNCpy_0 (proclabel, curr->typelabel, sizeof (proclabel)); if (proclabel [0] == '-') { proclabel [0] = '~'; } REGISTER_PROT_EDIT(procname,proclabel,subtype); } curr = FeatDefFindNext (curr, &key, &label, FEATDEF_ANY, TRUE); } REGISTER_GENE_EDIT; REGISTER_CDRGN_EDIT; REGISTER_RGNFEAT_EDIT; REGISTER_CMNTFEAT_EDIT; REGISTER_MOLINFO_EDIT; REGISTER_TITLE_EDIT; REGISTER_COMMENT_EDIT; REGISTER_NAME_EDIT; REGISTER_REGION_EDIT; REGISTER_BOND_EDIT; REGISTER_SITE_EDIT; REGISTER_PSEC_EDIT; REGISTER_GENBANK_EDIT; REGISTER_CREATE_DATE_EDIT; REGISTER_UPDATE_DATE_EDIT; REGISTER_UDV_AUTONOMOUS; REGISTER_NEW_BIOSEQ_EDIT; REGISTER_NEW_SEQALIGN_EDIT; REGISTER_NEW_SEQANNOT_EDIT; REGISTER_SUBMITBLOCK_EDIT; REG_INGENUE; } static CharPtr Ing_GetGIlist(CharPtr PNTR argv, Int4Ptr argcnt, Int4 argc) { CharPtr GI_list=NULL; Int4 i; i=*argcnt; GI_list=StringSave(argv[i]); i++; for (; i