コード例 #1
0
// AnalyzeSeqs family
int CReadBlastApp::AnalyzeSeqs(void)
{

   if(PrintDetails()) NcbiCerr << "AnalyzeSeqs: start " << NcbiEndl;
   PushVerbosity();
   if(IsSubmit())
     {
     if (
           m_Submit.GetData().IsEntrys()
            &&
           (*m_Submit.GetData().GetEntrys().begin())->IsSet()
        )
       {
       AnalyzeSeqs((*m_Submit.SetData().SetEntrys().begin())->SetSet().SetSeq_set());
       }
     else
       {
       NcbiCerr << "ERROR: submit file does not have proper seqset"<< NcbiCerr;
       }
     }
   else
     {
       AnalyzeSeqs(m_Entry.SetSet().SetSeq_set());
     }

   PopVerbosity();
   if(PrintDetails()) NcbiCerr << "AnalyzeSeqs: end" << NcbiEndl;
   return -1;
}
コード例 #2
0
ファイル: test5.c プロジェクト: melanj/lesstif
void
check_geometry()
{
  static int result_index = 0;

  static XtWidgetGeometry Expected[] =
  {
/* result test 0 */
   CWWidth | CWHeight            ,    0,    0,   70,   17, 0,0,0, /* Hello World */
   CWWidth | CWHeight | CWX | CWY,    0,  100,   42,   25, 0,0,0, /* hello */
/* result test 1 */
   CWWidth | CWHeight            ,    2,    2,   70,   17, 0,0,0, /* Hello World */
   CWWidth | CWHeight | CWX | CWY,    0,  100,   42,   25, 0,0,0, /* hello */
};

  if (result_index <= 1)
  {
     /* Only have results for two test.  Must record more results before
        doing any further testing otherwise you start looking at bogus
        memory locations.
      */
#if 0
     PrintDetails(grabshell, NULL);
#endif
     PrintDetails(grabshell, Expected);
     result_index ++;
  }
}
コード例 #3
0
int CReadBlastApp::AnalyzeSeqsViaBioseqs(
    CBioseq_set::TSeq_set& in_pool_seqs,
    CBioseq_set::TSeq_set& against_seqs,
    bool in_pool_prot, bool against_prot)
{
  if(PrintDetails()) NcbiCerr << "AnalyzeSeqsViaBioseqs(in_pool_seqs, against_seqs, in_pool_prot, against_prot): "
    << ", in_pool_prot= " << in_pool_prot
    << ", against_prot= " << against_prot << "\n";

    NON_CONST_ITERATE( CBioseq_set::TSeq_set, left, in_pool_seqs)
      {
      if((*left)->IsSet())
        {
        CBioseq_set::TSeq_set& seqs_down = (*left)->SetSet().SetSeq_set();
        AnalyzeSeqsViaBioseqs(seqs_down, against_seqs, in_pool_prot, against_prot);
        }
      else
        {
        string name = GetStringDescr((*left)->GetSeq());
        if(PrintDetails()) NcbiCerr << "AnalyzeSeqsViaBioseqs(in_pool_seqs, against_seqs, in_pool_prot, against_prot): "
           << "left seq entry "
           << name << "\n";
        if(   ( in_pool_prot &&  is_prot_entry((*left)->GetSeq())) ||
              (!in_pool_prot && !is_prot_entry((*left)->GetSeq()))
            )
          {
          AnalyzeSeqsViaBioseqs1((*left)->SetSeq());
          AnalyzeSeqsViaBioseqs((*left)->SetSeq(), against_seqs, against_prot);
          }
        }
      }

    return -1;

}
コード例 #4
0
ファイル: test19.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  XtAppContext	app;
  Widget Shell;
  Widget Form;
  Widget TopLabel;
  Widget BottomLabel;

  XtSetLanguageProc(NULL, NULL, NULL);

  Shell = XtVaAppInitialize(&app, "Shell", NULL, 0, &argc, argv, FallBack, NULL);

  Form = XmCreateForm(Shell,"Form",NULL,0);

  TopLabel = XmCreateLabel(Form,"TopLabel",NULL,0);
  XtVaSetValues(TopLabel,
  	XmNtopAttachment, XmATTACH_NONE,
  	NULL);
  XtManageChild(TopLabel);

  BottomLabel = XmCreateLabel(Form,"BottomLabel",NULL,0);
  XtVaSetValues(BottomLabel,
  	XmNtopAttachment, XmATTACH_WIDGET,
  	XmNtopWidget, TopLabel,
  	XmNtopOffset, 1,
  	XmNbottomAttachment, XmATTACH_POSITION,
  	XmNbottomOffset, 2,
  	XmNbottomPosition, 50,
  	NULL);
  XtManageChild(BottomLabel);

  XtManageChild(Form);

  XtRealizeWidget(Shell);
  {
  static XtWidgetGeometry Expected[] = {
  	CWWidth | CWHeight,		0,	0,	72,	81,	0,0,0,	/* Form */
  	CWWidth | CWHeight | CWX | CWY,	0,	0,	52,	17,	0,0,0,	/* two */
  	CWWidth | CWHeight | CWX | CWY,	0,	20,	70,	17,	0,0,0,	/* two */

  	CWWidth | CWHeight,		0,	0,	144,	160,	0,0,0,	/* Form */
  	CWWidth | CWHeight | CWX | CWY,	0,	0,	52,	17,	0,0,0,	/* two */
  	CWWidth | CWHeight | CWX | CWY,	0,	20,	70,	56,	0,0,0,	/* two */
};

  PrintDetails(Shell, Expected);
      LessTifTestWaitForIt(Shell);
      LessTifTestResizeWidget(Shell, 144, 160);
  PrintDetails(Shell, Expected);
  }
      LessTifTestMainLoop(Shell);
  exit(0);
}
コード例 #5
0
ファイル: missing.cpp プロジェクト: DmitrySigaev/ncbi
void CReadBlastApp::ugly_simple_overlaps_call(int& n_user_neighbors, int& n_ext_neighbors,
  TSimpleSeqs::iterator& ext_rna, 
  TSimpleSeqs::iterator& first_user_in_range, TSimpleSeqs::iterator& first_user_non_in_range, 
  TSimpleSeqs& seqs, int max_distance, 
  TSimpleSeqs::iterator& first_ext_in_range, TSimpleSeqs::iterator& first_ext_non_in_range, 
  string& bufferstr)
{
         if(PrintDetails())
           {
           if(first_user_in_range==seqs.end())
              {
              NcbiCerr << "ugly_simple_overlaps_call: first_user_in_range is already at the end" << NcbiEndl;
              }
           else
              {
              NcbiCerr << "ugly_simple_overlaps_call: first_user_in_range = " << printed_range(first_user_in_range) << NcbiEndl;
              }
           }

         n_user_neighbors = get_neighboring_sequences(ext_rna, first_user_in_range, first_user_non_in_range, 
                                                       seqs, max_distance);
         n_ext_neighbors = get_neighboring_sequences(ext_rna, first_ext_in_range, first_ext_non_in_range, 
                                                       m_extRNAtable2, max_distance);
         if(PrintDetails())
           {
           if(first_user_in_range==seqs.end())
              {
              NcbiCerr << "ugly_simple_overlaps_call: after call: first_user_in_range is already at the end" << NcbiEndl;
              }
           else
              {
              NcbiCerr << "ugly_simple_overlaps_call: after call: first_user_in_range = " << printed_range(first_user_in_range) << NcbiEndl;
              }
           }

         strstream buffer;
         addSimpleTab(buffer, "CENTER_REFERENCE", ext_rna, max_distance);
         for(TSimpleSeqs::iterator entry = first_ext_in_range; entry!= first_ext_non_in_range; entry++)
           {
           if(entry==ext_rna) continue; // addSimpleTab(buffer, "CENTER_REFERENCE", entry);
           else addSimpleTab(buffer, "REFERENCE", entry, max_distance);
           }
         for(TSimpleSeqs::iterator entry = first_user_in_range; entry!=first_user_non_in_range; entry++)
           {
           addSimpleTab(buffer, "VICINITY", entry, max_distance);
           }
         buffer << '\0';
         bufferstr=buffer.str();
}
コード例 #6
0
ファイル: test15.c プロジェクト: melanj/lesstif
static void
FinishTest(Widget W)
{
    PrintDetails(W);
    XtAppAddTimeOut(XtWidgetToApplicationContext(W), AppResources.time,
                    (XtTimerCallbackProc)DoAllTests, W);
}
コード例 #7
0
ファイル: test1.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  XtAppContext theApp;
  Widget toplevel;

  toplevel = XtVaAppInitialize(&theApp, "drawingArea", NULL, 0,
			       &argc, argv, NULL, NULL);

  butt1= XtVaCreateManagedWidget("Button1", xmArrowButtonWidgetClass, toplevel, 
				XmNarrowDirection,dir,
				NULL);

  XtAddCallback(butt1,XmNactivateCallback,HiCB,NULL);

  XtRealizeWidget(toplevel);

  
{
    static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   50,   50,   23,   23, 0,0,0, /* Button1 */ 
    };
    PrintDetails(toplevel,Expected);
};
  LessTifTestMainLoop(toplevel);

  exit(0);
}
コード例 #8
0
ファイル: test9.c プロジェクト: melanj/lesstif
int main(int argc, char **argv)
{
 XtAppContext app;
 Widget one;
 XmString s1, s2;
 int i;
 

 
 toplevel = XtVaAppInitialize(&app, "test", NULL, 0, &argc, argv, NULL, NULL);

 one = XtVaCreateManagedWidget("Push me",
        xmPushButtonWidgetClass,
        toplevel, NULL);
 
 XtAddCallback(one, XmNactivateCallback, ChangeWindefTitleParameterCB, NULL);
 XtRealizeWidget(toplevel);

 s1 = XmStringCreateLtoR("ala ma pieska", "");
 s2 = XmStringCreateLocalized("ala ma pieska");
 i = XmStringCompare(s1, s2);
 printf("%d\n", i); /* on original Motif should be 1 */

 
{
    static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   50,   50,   54,   25, 0,0,0, /* Push me */ 
    };
    PrintDetails( toplevel ,Expected);
};
   LessTifTestMainLoop( toplevel );
   
   exit(0);
}
コード例 #9
0
ファイル: test4.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  XtAppContext theApp;
  Widget toplevel, drawingArea, button, m;

  toplevel = XtVaAppInitialize(&theApp, "drawingArea", NULL, 0,
			       &argc, argv, NULL, NULL);

  drawingArea= XtVaCreateManagedWidget("drawingArea", xmDrawingAreaWidgetClass, toplevel,
	NULL);

  m = XmCreatePopupMenu(drawingArea, "popup", NULL, 0);
  
  button = XtVaCreateManagedWidget("button", xmPushButtonWidgetClass, m,
	NULL);

  XtAddCallback(drawingArea, XmNinputCallback, incb, (XtPointer)m);
  XtAddCallback(button, XmNactivateCallback, print, NULL);

  XtRealizeWidget(toplevel);
  
{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,  506,  322,    1,    1, 0,0,0, /* drawingArea */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}

  LessTifTestMainLoop(toplevel);

  exit(0);
}
コード例 #10
0
ファイル: test9.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
    Widget toplevel, button;
    XtAppContext app;

    toplevel = XtVaAppInitialize(&app, "Hello", NULL, 0,
				 &argc, argv, fallbacks, NULL);

    button =
	XtVaCreateManagedWidget("pushmePlease", xmPushButtonWidgetClass,
				toplevel, NULL);

    XtAddCallback(button, XmNactivateCallback, mytest, NULL);

    XtRealizeWidget(toplevel);
  {
  static XtWidgetGeometry Expected[] = {
  	CWWidth | CWHeight,		0,	0,	100,	41,	0,0,0,	/* Form */
  	CWWidth | CWHeight | CWX | CWY,	45,	30,	30,	25,	0,0,0,	/* two */
};

  PrintDetails(toplevel, Expected);
  }
  LessTifTestMainLoop(toplevel);
  /*
    XtAppMainLoop(app);
    */
    exit(0);
}
コード例 #11
0
ファイル: test2.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  XtAppContext app;
  Widget toplevel, box;

  toplevel = XtVaAppInitialize(&app, "listTest", NULL, 0,
 		               &argc, argv, NULL, NULL);

  box = XmCreateSelectionBox(toplevel, "Box", NULL, 0);

  XtManageChild(box);

  XtRealizeWidget(toplevel);

  
{
    static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   56,   72,  220,  297, 0,0,0, /* Box */
   CWWidth | CWHeight | CWX | CWY,   11,   11,  198,   17, 0,0,0, /* Items */
   CWWidth | CWHeight | CWX | CWY,   11,   28,  198,  135, 0,0,0, /* ItemsListSW */
   CWWidth | CWHeight | CWX | CWY,    0,    0,  198,  135, 0,0,0, /* ItemsList */
   CWWidth | CWHeight | CWX | CWY,   11,  173,  198,   17, 0,0,0, /* Selection */
   CWWidth | CWHeight | CWX | CWY,   11,  190,  198,   31, 0,0,0, /* Text */
   CWWidth | CWHeight | CWX | CWY,    0,  231,  220,    2, 0,0,0, /* Separator */
   CWWidth | CWHeight | CWX | CWY,   11,  243,   66,   43, 0,0,0, /* OK */
   CWWidth | CWHeight | CWX | CWY,   77,  243,   66,   43, 0,0,0, /* Cancel */
   CWWidth | CWHeight | CWX | CWY,  143,  243,   66,   43, 0,0,0, /* Help */ 
    };
    PrintDetails(toplevel,Expected);
};
  LessTifTestMainLoop(toplevel);

  exit(0);
}
コード例 #12
0
ファイル: test60.c プロジェクト: melanj/lesstif
int main(int argc, char *argv[])
{
	Widget	a, b;

	XtSetLanguageProc(NULL, NULL, NULL);
	toplevel = XtVaAppInitialize(&appcontext, "Test", NULL, 0, &argc, argv,
				     NULL, NULL);

/* Create main window */
	form = XtVaCreateManagedWidget("form", xmFormWidgetClass, toplevel,
		XmNfractionBase,	7,
		XmNwidth,		350,
		XmNheight,		100,
		NULL);

	a = XtVaCreateManagedWidget("label a", xmPushButtonWidgetClass, form,
		XmNx,			50,
		XmNwidth,		100,
		XmNtopAttachment,	XmATTACH_POSITION,
		XmNtopPosition,		1,
		XmNleftAttachment,	XmATTACH_SELF,
		XmNrightAttachment,	XmATTACH_SELF,
		XmNbottomAttachment,	XmATTACH_POSITION,
		XmNbottomPosition,	5,
		NULL);

	b = XtVaCreateManagedWidget("label b", xmPushButtonWidgetClass, form,
		XmNx,			200,
		XmNwidth,		100,
		XmNtopAttachment,	XmATTACH_POSITION,
		XmNtopPosition,		1,
		XmNleftAttachment,	XmATTACH_SELF,
		XmNrightAttachment,	XmATTACH_SELF,
		XmNbottomAttachment,	XmATTACH_POSITION,
		XmNbottomPosition,	5,
		NULL);
	XtManageChild(form);

	XtRealizeWidget(toplevel);

    {
/* Note: the following values are the result of
 * querying the current geometry.
 */
static XtWidgetGeometry Expected[] = {
   {CWWidth | CWHeight            ,    0,    0,  350,  100, 0,0,0, /* mainwindow */},
   {CWWidth | CWHeight | CWX | CWY,   50,   14,  100,   57, 0,0,0, /* menubar */},
   {CWWidth | CWHeight | CWX | CWY,  200,   14,  100,   57, 0,0,0, /* button_0 */},
};

	PrintDetails(toplevel, Expected);
    }

	/*
	XtAppMainLoop(appcontext);
	*/
	LessTifTestMainLoop(toplevel);

	return(0);
}
コード例 #13
0
ファイル: test32.c プロジェクト: melanj/lesstif
int main(int argc, char *argv[])
{
  XtAppContext appContext;

  topLevel = XtAppInitialize(&appContext, "Menus", 0, 0,
					  &argc, argv, 0, 0, 0);

  layoutApplication(topLevel);
  XtRealizeWidget(topLevel);
  {
  static XtWidgetGeometry Expected[] = {
  	CWWidth | CWHeight,		0,	0,	226,	35,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	0,	0,	134,	31,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	3,	3,	52,	25,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	58,	3,	73,	25,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	134,	0,	92,	35,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	3,	3,	4,	29,	0,0,0,
  	CWWidth | CWHeight | CWX | CWY,	10,	3,	79,	29,	0,0,0,
};

  PrintDetails(topLevel, Expected);
  }
    LessTifTestMainLoop(topLevel);
    /*
  XtAppMainLoop(appContext);
  */
  return 0;
}
コード例 #14
0
int CReadBlastApp::AnalyzeSeqsViaBioseqs(CBioseq& left,
    CBioseq_set::TSeq_set& against_seqs, bool against_prot)
{
  if(PrintDetails()) NcbiCerr << "AnalyzeSeqsViaBioseqs(left, against_seqs, against_prot): "
    << GetStringDescr(left)
    << ", against_prot= " << against_prot << "\n";
  NON_CONST_ITERATE( CBioseq_set::TSeq_set, right, against_seqs)
      {
      if((*right)->IsSet())
        {
        CBioseq_set::TSeq_set& seqs_down = (*right)->SetSet().SetSeq_set();
        AnalyzeSeqsViaBioseqs(left, seqs_down, against_prot);
        }
      else
        {
        string name = GetStringDescr((*right)->GetSeq());
/*
        if(PrintDetails()) NcbiCerr << "AnalyzeSeqsViaBioseqs(left, against_seqs, against_prot): "
           << "right seq entry "
           << name << "\n";
*/
        if(   ( against_prot &&  is_prot_entry((*right)->GetSeq())) ||
              (!against_prot && !is_prot_entry((*right)->GetSeq()))
            )
        AnalyzeSeqsViaBioseqs(left, (*right)->SetSeq() );
        }
      }
  return -1;
}
コード例 #15
0
int CReadBlastApp::AnalyzeSeqsViaBioseqs(bool in_pool_prot, bool against_prot)
{
  if(PrintDetails()) NcbiCerr << "AnalyzeSeqsViaBioseqs(in_pool_prot, against_prot) " << "\n";
   if(IsSubmit())
     {
     if (
           m_Submit.GetData().IsEntrys()
            &&
           (*m_Submit.GetData().GetEntrys().begin())->IsSet()
        )
       {
       CBioseq_set::TSeq_set& seqs =  (*m_Submit.SetData().SetEntrys().begin())->SetSet().SetSeq_set();
       AnalyzeSeqsViaBioseqs(seqs, seqs, in_pool_prot, against_prot);
       }
     else
       {
       NcbiCerr << "ERROR: submit file does not have proper seqset"<< NcbiCerr;
       }
     }
   else
     {
     CBioseq_set::TSeq_set& seqs =  m_Entry.SetSet().SetSeq_set();
     AnalyzeSeqsViaBioseqs(seqs, seqs, in_pool_prot, against_prot);
     }

   return -1;

}
コード例 #16
0
ファイル: test4.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  Widget toplevel, one,two;
  XtAppContext app;

  XtSetLanguageProc(NULL, NULL, NULL);

  toplevel = XtVaAppInitialize(&app, "PBG1", NULL, 0, &argc, argv, NULL, NULL);

  two = XtVaCreateManagedWidget("Two", xmBulletinBoardWidgetClass, toplevel, NULL);

  one = XtVaCreateManagedWidget("OneBlueButton", xmPushButtonGadgetClass, two, NULL);

  XtAddCallback(one, XmNactivateCallback, activate_callback, NULL);
  XtAddCallback(one, XmNarmCallback, arm_callback, NULL);
  XtAddCallback(one, XmNdisarmCallback, disarm_callback, NULL);

  XtRealizeWidget(toplevel);
  {
  static XtWidgetGeometry Expected[] = {
  	CWWidth | CWHeight,		0,	0,	111,	46,	0,0,0,	/* Form */
  	CWWidth | CWHeight | CWX | CWY,	10,	10,	90,	25,	0,0,0,	/* two */
};

  PrintDetails(toplevel, Expected);
  }
  LessTifTestMainLoop(toplevel);
  /*
  XtAppMainLoop(app);
  */

  exit(0);
}
コード例 #17
0
ファイル: test5.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  XtAppContext theApp;
  Widget toplevel;

  toplevel = XtVaAppInitialize(&theApp, "toggle1", NULL, 0,
			       &argc, argv, NULL, NULL);

  butt= XtVaCreateManagedWidget("Button1Button1", xmToggleButtonWidgetClass, toplevel, 
				XmNindicatorOn, False,
				XmNshadowThickness, 5,
#if 0
				XmNfillOnSelect, True,
#endif
				NULL);

  XtAddCallback(butt,XmNvalueChangedCallback,HiCB,NULL);

  XtRealizeWidget(toplevel);

/* Note: the following values are the result of
 * querying the current geometry.
 */
{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,    0,    0,  102,   31, 0,0,0, /* Button1Button1 */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
LessTifTestMainLoop(toplevel);

  exit(0);
}
コード例 #18
0
ファイル: test6.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  Widget toplevel, one, two;
  XtAppContext app;
  XmFontList fontlist;
  XmString xmstr1;
  Dimension w,i,s,l,t,h;

  XtSetLanguageProc(NULL, NULL, NULL);

  toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, FallBack, NULL);

  fontlist = XmFontListAppendEntry(NULL,
			   XmFontListEntryCreate("MY_FONT",
						 XmFONT_IS_FONT,
						 XLoadQueryFont(XtDisplay(toplevel), 
 	                                         "-adobe-helvetica-bold-o-normal--17-0-75-75-p-*-iso8859-1")));

  xmstr1 = XmStringCreateLtoR("Here\nIs\nA\nDefault\nButton", "MY_FONT");

  two = XtVaCreateManagedWidget("Button1", xmBulletinBoardWidgetClass,
				 toplevel, NULL);

  one = XtVaCreateManagedWidget("One", 
                                xmPushButtonGadgetClass, 
                                two, 
				XmNfontList, fontlist, 
				XmNlabelString, xmstr1, 
				XmNshowAsDefault, 1,
				XmNdefaultButtonShadowThickness, 3,
				NULL);

  XtRealizeWidget(toplevel);
  XtVaGetValues(one,
		XmNhighlightThickness, &i,
		XmNshadowThickness, &s,
		XmNmarginWidth, &w,
		XmNmarginHeight, &h,
		XmNmarginLeft, &l,
		XmNmarginTop, &t,
		NULL);

printf("highlight: %d shad: %d marWid: %d marHei: %d marLeft: %d marTop: %d\n",
	 i, s, w, h, l, t);

/* Note: the following values are the result of
 * querying the current geometry.
 */
{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,    0,    0,  113,  143, 0,0,0, /* Button1 */
   CWWidth | CWHeight | CWX | CWY,   10,   10,   92,  122, 0,0,0, /* One */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
LessTifTestMainLoop(toplevel);
  exit(0);
}
コード例 #19
0
ファイル: test8.c プロジェクト: melanj/lesstif
int
main (int argc, char *argv[])
{
	XtSetLanguageProc ( (XtAppContext) NULL, (XtLanguageProc) NULL, (XtPointer) NULL );
	XtToolkitInitialize ();
	app_context = XtCreateApplicationContext ();
	display = XtOpenDisplay (app_context, NULL, argv[0], "XApplication",
				 NULL, 0, &argc, argv);
	if (!display)
	{
	    printf("%s: can't open display, exiting...\n", argv[0]);
	    exit (-1);
	}
	create_shell ( display, argv[0], argc, argv );
	XtRealizeWidget (shell);
	
/* Note: the following values are the result of
 * querying the current geometry.
 */
{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,  361,  266,   74,  400, 0,0,0, /* form */
   CWWidth | CWHeight | CWX | CWY,    0,    0,   74,  260, 0,0,0, /* list1SW */
   CWWidth | CWHeight | CWX | CWY,    0,    0,   74,  260, 0,0,0, /* list1 */
   CWWidth | CWHeight | CWX | CWY,    0,  260,   74,  140, 0,0,0, /* da */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(shell, Expected);
}

	LessTifTestMainLoop(shell);
	exit (0);
}
コード例 #20
0
ファイル: test2.c プロジェクト: melanj/lesstif
int
main (int argc, char **argv)
{
  XtAppContext theApp;
  Widget butt1;

  toplevel = XtVaAppInitialize (&theApp, "LessTifTest", NULL, 0,
				&argc, argv, NULL, NULL);

  butt1 = XtVaCreateManagedWidget ("Button1", xmPushButtonWidgetClass, toplevel,
				   NULL, 0);

  XtAddCallback (butt1, XmNactivateCallback, HiCB, NULL);

  XtRealizeWidget (toplevel);

  LessTifTestWaitForIt(toplevel);
  LessTifTestPushButton(butt1);

{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,  507,  323,   54,   25, 0,0,0, /* Button1 */
   CWWidth | CWHeight            ,  490,  308,  100,  100, 0,0,0, /* OK */
   CWWidth | CWHeight | CWX | CWY,   10,   15,   80,   25, 0,0,0, /* OK */
   CWWidth | CWHeight | CWX | CWY,   10,   60,   80,   25, 0,0,0, /* Cancel */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
  LessTifTestMainLoop(toplevel);

  exit (0);
}
コード例 #21
0
ファイル: test6.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  Widget toplevel, one;
  XtAppContext app;
  XmFontList fontlist;
  XmString xmstr1 = XmStringCreateLtoR("Here is a\n", "MY_FONT1");
  XmString xmstr2 = XmStringCreate("different font", "MY_FONT");
  XmString xmstr3 = XmStringCreate("accelerator", "MY_FONT");
  XmStringContext context;
  char *text;
  XmStringCharSet tag;
  XmStringDirection dir;
  Boolean sep;

  XmString xmstr = XmStringConcat(xmstr1, xmstr2);

  XtSetLanguageProc(NULL, NULL, NULL);

  toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, FallBack, NULL);

  XmStringInitContext(&context, xmstr);
  while (XmStringGetNextSegment(context, &text, &tag, &dir, &sep)) {
	printf("Text: %s Tag: %s Dir: %d Sep: %d\n", text, tag, dir, sep);
	fflush(stdout);
  }

  fontlist = XmFontListAppendEntry(NULL,
			   XmFontListEntryCreate("MY_FONT",
						 XmFONT_IS_FONT,
						 XLoadQueryFont(XtDisplay(toplevel), 
 	                                         "-adobe-helvetica-bold-o-normal--17-0-75-75-p-*-iso8859-1")));

  fontlist = XmFontListAppendEntry(fontlist,
			   XmFontListEntryCreate("MY_FONT1",
						 XmFONT_IS_FONT,
						 XLoadQueryFont(XtDisplay(toplevel), 
 	                                         "-adobe-helvetica-bold-o-normal--30-*-*-*-*-*-iso8859-1")));

  one = XtVaCreateManagedWidget("One", xmLabelWidgetClass, toplevel, XmNfontList, fontlist, 
				XmNlabelString, xmstr,
				XmNacceleratorText, xmstr3, NULL);

  printf("xmstr: %p %p\n", xmstr, ((XmLabelRec*)one)->label._label);
  XtRealizeWidget(toplevel);
  {
  static XtWidgetGeometry Expected[] = {
  	CWWidth | CWHeight,		0,	0,	128,	55,	0,0,0,	/* Form */
};

  PrintDetails(toplevel, Expected);
  }
  LessTifTestMainLoop(toplevel);
  /*
  XtAppMainLoop(app);
  */

  exit(0);
}
コード例 #22
0
ファイル: test2.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
	Widget toplevel, one, d;
	XtAppContext app;
	XmFontList fontlist;

	XmString xmstr1 = XmStringCreateLtoR("\n\nHere is a\n\n", "MY_FONT1");
	XmString xmstr2 = XmStringCreate("different font", "MY_FONT");
	XmString xmstr3 = XmStringCreate("accelerator", "MY_FONT");
	XmStringContext context;
	char *text;
	XmStringCharSet tag;
	XmStringDirection dir;
	Boolean sep;

	XmString xmstr = XmStringConcat(xmstr1, xmstr2);

	XtSetLanguageProc(NULL, NULL, NULL);

	toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, NULL, NULL);

	d = XmGetXmDisplay(XtDisplay(toplevel));
	XtAddCallback(d, XmNnoFontCallback, NoFontCB, NULL);
	XtAddCallback(d, XmNnoRenditionCallback, NoRenditionCB, NULL);

	fontlist = XmFontListAppendEntry(NULL,
		XmFontListEntryCreate("MY_FONT",
			XmFONT_IS_FONT,
			XLoadQueryFont(XtDisplay(toplevel),
			"-adobe-helvetica-bold-o-normal--17-0-75-75-p-*-iso8859-1")));
	fontlist = XmFontListAppendEntry(fontlist,
		XmFontListEntryCreate("MY_FONT1",
			XmFONT_IS_FONT,
			XLoadQueryFont(XtDisplay(toplevel),
			"-adobe-helvetica-bold-r-normal--17-0-75-75-p-*-iso8859-1")));

	one = XtVaCreateManagedWidget("One", xmLabelWidgetClass, toplevel,
		XmNfontList, fontlist,
		XmNlabelString, xmstr,
		XmNacceleratorText, xmstr3,
		NULL);

	XtRealizeWidget(toplevel);

/* Note: the following values are the result of
 * querying the current geometry.
 */
{
static XtWidgetGeometry Expected[] = {
   {CWWidth | CWHeight            ,    0,    0,  112,   58, 0,0,0}, /* One */
};
/* toplevel should be replaced with to correct applicationShell */
	PrintDetails(toplevel, Expected);
}

	LessTifTestMainLoop(toplevel);
	exit(0);
}
コード例 #23
0
ファイル: test4.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
	Widget		toplevel, one, d;
	XtAppContext	app;
	XmFontList	fontlist;
	XmString	xms;
	Arg           args[10];
	XmTab         tabs[MAX_COLUMNS];
	XmTabList     tablist;
	XmRendition   renditions[MAX_COLUMNS];
	XmRenderTable rendertable;
	XmStringTable xmstring_table;
	int           xmstring_count;
	Pixel         pixels[MAX_COLUMNS];
	int           n, i;

	XtSetLanguageProc(NULL, NULL, NULL);
	toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv,
		fallback, NULL);

	d = XmGetXmDisplay(XtDisplay(toplevel));

	/* Create the multi-column data for the list */

	xmstring_table = CreateListData(&xmstring_count) ;

	xms = xmstring_table[0];
	for (i=1; i<xmstring_count; i++) {
		XmString	s, x;
		s = XmStringSeparatorCreate();
		x = XmStringConcat(xms, s);
		xms = XmStringConcat(x, xmstring_table[i]);
	}

	one = XtVaCreateManagedWidget("One", xmLabelWidgetClass, toplevel,
		XmNalignment,	XmALIGNMENT_BEGINNING,
		XmNlabelString, xms,
		NULL);

	XtRealizeWidget(toplevel);

#if 0
/* Note: the following values are the result of
 * querying the current geometry.
 */
{
static XtWidgetGeometry Expected[] = {
   {CWWidth | CWHeight            ,    0,    0,  112,   58, 0,0,0}, /* One */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
#endif

	LessTifTestMainLoop(toplevel);
	exit(0);
}
コード例 #24
0
ファイル: missing.cpp プロジェクト: DmitrySigaev/ncbi
bool CReadBlastApp::CheckMissingRibosomalRNA
  (
  const CBioseq::TAnnot& annots
  )
{
   bool result = false;
   if(PrintDetails()) NcbiCerr << "CheckMissingRibosomalRNA[annots] starts" << NcbiEndl;
   IncreaseVerbosity();
   ITERATE(CBioseq::TAnnot, gen_feature, annots)
     {
     if ( !(*gen_feature)->GetData().IsFtable() ) continue;
     bool lres = CheckMissingRibosomalRNA((*gen_feature)->GetData().GetFtable());
     result = lres || result;
     }
   DecreaseVerbosity();
   if(PrintDetails()) NcbiCerr << "CheckMissingRibosomalRNA[annots] ends" << NcbiEndl;
   return result;
}
コード例 #25
0
ファイル: test5.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
    XtAppContext app;
    Arg arg[1];
    
    toplevel = XtVaAppInitialize(&app, "listTest", NULL, 0,
				 &argc, argv, fallbacks, NULL);

    formw = XmCreateForm(toplevel, "form", NULL, 0);
    button1 = XmCreatePushButton(formw, "button", NULL, 0);

    listw = XmCreateScrolledList(formw, "list", arg, 0); 

    XtVaSetValues(XtParent(listw),
		  XmNtopAttachment, XmATTACH_FORM,
		  XmNbottomAttachment, XmATTACH_WIDGET,
                  XmNbottomWidget, button1,
		  XmNleftAttachment, XmATTACH_FORM,
		  XmNrightAttachment, XmATTACH_FORM,
		  NULL);

    XtVaSetValues(button1,
		  XmNtopAttachment, XmATTACH_NONE,
		  XmNbottomAttachment, XmATTACH_FORM,
		  XmNleftAttachment, XmATTACH_FORM,
		  XmNrightAttachment, XmATTACH_FORM,
		  NULL);

    XtManageChild(formw);
    XtManageChild(button1);
    XtManageChild(listw);

    XtRealizeWidget(toplevel);

    XtAddCallback(button1, XmNactivateCallback, button_cb1, NULL);

    XdbPrintTree(toplevel);


{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   56,   72,   78,  131, 0,0,0, /* form */
   CWWidth | CWHeight | CWX | CWY,    0,  106,   78,   25, 0,0,0, /* button */
   CWWidth | CWHeight | CWX | CWY,    0,    0,   78,  106, 0,0,0, /* listSW */
   CWWidth | CWHeight | CWX | CWY,   63,    0,   15,   87, 0,0,0, /* VertScrollBar */
   CWWidth | CWHeight | CWX | CWY,    0,   91,   59,   15, 0,0,0, /* HorScrollBar */
   CWWidth | CWHeight | CWX | CWY,    0,    0,   59,   87, 0,0,0, /* list */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
  LessTifTestMainLoop(toplevel);

    exit(0);
}
コード例 #26
0
ファイル: test11.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
  Widget toplevel, one, two;
  XtAppContext app;
  unsigned int maximum;
  XmString str;

  XtSetLanguageProc(NULL, NULL, NULL);

  toplevel = XtVaAppInitialize(&app, "Scale", NULL, 0, &argc, argv, NULL, NULL);

  one = XtVaCreateManagedWidget("form", xmFormWidgetClass, toplevel,
                                NULL);

  str = XmStringCreateLtoR("Test Scale", XmFONTLIST_DEFAULT_TAG);

  two = XtVaCreateManagedWidget("sb", xmScaleWidgetClass, one, 
                                XmNtopAttachment,  XmATTACH_FORM,
                                XmNleftAttachment,  XmATTACH_FORM,
                                XmNrightAttachment,  XmATTACH_FORM,
                                XmNbottomAttachment,  XmATTACH_FORM,
                                XmNorientation, XmHORIZONTAL, 
				XmNshowValue, True,
#if 0
                                XmNscaleWidth, 40,
#endif
				XmNminimum, 100,
				XmNmaximum, 300,
				XmNtitleString, str,
				XmNprocessingDirection, XmMAX_ON_LEFT,
				NULL);

  XtAddCallback(two, XmNdragCallback, dragCallback, NULL);
  XtAddCallback(two, XmNvalueChangedCallback, valueChangedCallback, NULL);

  XtRealizeWidget(toplevel);

  XtVaGetValues(two, XmNmaximum, &maximum, NULL);

  printf ("one.maximum = %u\n", maximum);

  
{
    static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   50,   50,  104,   56, 0,0,0, /* form */
   CWWidth | CWHeight | CWX | CWY,    0,    0,  104,   56, 0,0,0, /* sb */
   CWWidth | CWHeight | CWX | CWY,    0,   35,   64,   17, 0,0,0, /* Title */
   CWWidth | CWHeight | CWX | CWY,    0,   16,  104,   19, 0,0,0, /* Scrollbar */ 
    };
    PrintDetails(toplevel,Expected);
};
  LessTifTestMainLoop(toplevel);

  exit(0);
}
コード例 #27
0
ファイル: test9.c プロジェクト: melanj/lesstif
int
main(int argc, char *argv[]) {
    Widget rc, frame1, label;

    XtSetLanguageProc(NULL, NULL, NULL);

    top = XtVaAppInitialize(&app_context,
                            "Test-prog",
                            NULL, 0,
                            &argc, argv,
                            NULL,
                            NULL);

    main_window =
        XtVaCreateManagedWidget("mainwin", xmMainWindowWidgetClass, top, NULL);

    XmRepTypeInstallTearOffModelConverter();

    menubar = XmCreateMenuBar(main_window, "menubar", NULL, 0);
    XtManageChild(menubar);

    XmMainWindowSetAreas(main_window,menubar,NULL,NULL,NULL,NULL);

    rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, main_window, NULL);

    XtVaSetValues(main_window, XmNworkWindow, rc, NULL);
    XtManageChild(rc);

    frame1 = XtVaCreateWidget("frame1",
                              xmFrameWidgetClass,
                              rc,
                              NULL);
    XtManageChild(frame1);

    XtRealizeWidget(top);

    label = XtVaCreateManagedWidget("Rampaging Bulldozers",
                                    xmLabelWidgetClass,
                                    frame1,
                                    NULL);

    {
        static XtWidgetGeometry Expected[] = {
            CWWidth | CWHeight            ,   56,   72,   16,   32, 0,0,0, /* mainwin */
            CWWidth | CWHeight | CWX | CWY,    0,    0,   16,   16, 0,0,0, /* menubar */
            CWWidth | CWHeight | CWX | CWY,    0,   16,   16,   16, 0,0,0, /* rc */
            CWWidth | CWHeight | CWX | CWY,    3,    3,   10,    4, 0,0,0, /* frame1 */
            CWWidth | CWHeight | CWX | CWY,    2,    2,    6,    1, 0,0,0, /* Rampaging Bulldozers */
        };
        /* toplevel should be replaced with to correct applicationShell */
        PrintDetails(top, Expected);
    }
    LessTifTestMainLoop(top);

    exit(0);
}
コード例 #28
0
void CReadBlastApp::GetGenomeLen()
{
    for (CTypeIterator<CBioseq> seq = Begin();  seq;  ++seq)
      {
// check if na
      if(seq->GetInst().GetMol()!=CSeq_inst::eMol_dna) continue;
      if(PrintDetails()) NcbiCerr << "GetGenomeLen: found DNA" << NcbiEndl;
      m_length = seq->GetInst().GetLength(); // let the toolkit take care of exception
      } // end iteration over all genomic sequences
}
コード例 #29
0
ファイル: test12.c プロジェクト: melanj/lesstif
int
main (int argc, char **argv)
{
  XtAppContext theApp;
  Widget dialog, rc, label;
  XmString xmstr;

  toplevel = XtVaAppInitialize (&theApp, "drawingArea", NULL, 0,
				&argc, argv, NULL, NULL);
     XtVaSetValues(toplevel,
     	XmNallowShellResize, True,
     	NULL);
     dialog = XmCreateMessageBox(toplevel, "MyDialog", NULL, 0);
     xmstr = XmStringCreateLtoR("Hello World\n\nIf you hit OK on this dialog, another one"
				      "\nshould appear, positioned to the lower right of this one.",
				      XmFONTLIST_DEFAULT_TAG);
  
  
     XtVaSetValues(dialog, XmNmessageString, xmstr, NULL);
  
#if 1
     rc = XmCreateRowColumn(dialog, "rc", NULL, 0);
#else
     rc = XmCreateForm(dialog, "rc", NULL, 0);
#endif
     label = XmCreateLabel(rc, "label", NULL, 0);
     XtVaSetValues(label,
     	XmNborderWidth, 1,
     	NULL);
     XtManageChild(label);
     XtManageChild(rc);
  XtManageChild (dialog);


  XtRealizeWidget (toplevel);

{
static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   56,   72,  368,  176, 0,0,0, /* MyDialog */
   CWWidth | CWHeight | CWX | CWY,    0,    0,    4,    4, 0,0,0, /* Symbol */
   CWWidth | CWHeight | CWX | CWY,   11,   11,  346,   56, 0,0,0, /* Message */
   CWWidth | CWHeight | CWX | CWY,    0,  112,  368,    2, 0,0,0, /* Separator */
   CWWidth | CWHeight | CWX | CWY,   11,  124,   64,   41, 0,0,0, /* OK */
   CWWidth | CWHeight | CWX | CWY,  152,  124,   64,   41, 0,0,0, /* Cancel */
   CWWidth | CWHeight | CWX | CWY,  293,  124,   64,   41, 0,0,0, /* Help */
   CWWidth | CWHeight | CWX | CWY,   11,   77,  346,   25, 0,0,0, /* rc */
   CWWidth | CWHeight | CWX | CWY,    3,    3,  338,   17, 0,0,0, /* label */
};
/* toplevel should be replaced with to correct applicationShell */
PrintDetails(toplevel, Expected);
}
  LessTifTestMainLoop(toplevel);

  exit (0);
}
コード例 #30
0
ファイル: test1.c プロジェクト: melanj/lesstif
int
main(int argc, char **argv)
{
    XtAppContext theApp;
    Widget toplevel, rc;
    Widget cascade1;
    Widget pane1;
    Widget w;

    toplevel = XtVaAppInitialize(&theApp, "test1", NULL, 0,
				 &argc, argv, NULL, NULL);

    rc = XmCreateMenuBar(toplevel, "menubar", NULL, 0);

    pane1 = XmCreatePulldownMenu(rc, "pane1", NULL, 0);

    /* put a tear off button on this pulldown */
    XtVaSetValues(pane1, 
                  XmNtearOffModel, XmTEAR_OFF_ENABLED,
                  NULL);

    cascade1 = XtVaCreateManagedWidget("cascade1", xmCascadeButtonWidgetClass, rc,
		XmNsubMenuId, pane1,
	NULL);

    w = XtVaCreateManagedWidget("button 1", xmPushButtonWidgetClass, pane1, NULL);
    XtAddCallback(w, XmNactivateCallback, Callback, "Activate");
    XtAddCallback(w, XmNarmCallback, Callback, "Arm");
    XtAddCallback(w, XmNdisarmCallback, Callback, "Disarm");

    w = XtVaCreateManagedWidget("button 2", xmPushButtonWidgetClass, pane1, NULL);
    XtAddCallback(w, XmNactivateCallback, Callback, "Activate");
    XtAddCallback(w, XmNarmCallback, Callback, "Arm");
    XtAddCallback(w, XmNdisarmCallback, Callback, "Disarm");

    w = XtVaCreateManagedWidget("button 2", xmSeparatorWidgetClass, pane1, NULL);

    w = XtVaCreateManagedWidget("gadget 3", xmPushButtonGadgetClass, pane1, NULL);
    XtAddCallback(w, XmNactivateCallback, Callback, "Activate");
    XtAddCallback(w, XmNarmCallback, Callback, "Arm");
    XtAddCallback(w, XmNdisarmCallback, Callback, "Disarm");

    XtManageChild(rc);
    XtRealizeWidget(toplevel);
    
{
    static XtWidgetGeometry Expected[] = {
   CWWidth | CWHeight            ,   50,   50,   74,   31, 0,0,0, /* menubar */
   CWWidth | CWHeight | CWX | CWY,    5,    5,   64,   21, 0,0,0, /* cascade1 */ 
    };
    PrintDetails(    toplevel ,Expected);
};
   LessTifTestMainLoop(    toplevel );    
    exit(0);
}