Esempio n. 1
0
int MakeimportGroup(DIALOG *D,void *arg) {
   int GrpId;
   WIDGETGRP *Gpt;
/*************************************************

    ThumbnailBrowser1  1 data value
    ThumbnailBrowser2  1 data value

*************************************************/
   int  *v0 ;
   v0 = (int *)malloc(sizeof(int));
   *v0 = 1;
   int  *v1 ;
   v1 = (int *)malloc(sizeof(int));
   *v1 = 1;
   void** v=(void **)malloc(sizeof(void*)*3);
   v[2]=NULL;
   v[0]=(void *)(v0);
   v[1]=(void *)(v1);
   void *pt=NULL; /* pointer to send any extra information */
   GrpId = importGroup(D,v,pt);
   Gpt = kgGetWidgetGrp(D,GrpId);
   Gpt->arg= v;
   return GrpId;
}
Esempio n. 2
0
        bool Rest::fromXElement( std::ostream& message, xml::XElement& xelement )
        {
            bool isSuccess = true;
            isSuccess &= myAttributes->fromXElement( message, xelement );

            auto it = xelement.elementsBegin();
            auto endIter = xelement.elementsEnd();
            importGroup( message, it, endIter, isSuccess, myDisplayStepOctaveGroup );
            myHasDisplayStepOctaveGroup = isSuccess;
            return isSuccess;
        }
        bool FiguredBass::fromXElementImpl( std::ostream& message, xml::XElement& xelement )
        {
            bool isSuccess = true;
            isSuccess &= myAttributes->fromXElement( message, xelement );

            auto endIter = xelement.end();
            for( auto it = xelement.begin(); it != endIter; ++it )
            {
                importElementSet( message, it, endIter, isSuccess, "figure", myFigureSet );
                if ( importElement( message, *it, isSuccess, *myDuration, myHasDuration ) ) { continue; }
                importGroup( message, it, endIter, isSuccess, myEditorialGroup );
            }

            return isSuccess;
        }
Esempio n. 4
0
        bool Defaults::fromXElementImpl( std::ostream& message, xml::XElement& xelement )
        {
            bool isSuccess = true;

            auto endIter = xelement.end();
            for( auto it = xelement.begin(); it != endIter; ++it )
            {
                if ( importElement( message, *it, isSuccess, *myScaling, myHasScaling ) ) { continue; }
                importGroup( message, it, endIter, isSuccess, myLayoutGroup );
                if ( importElement( message, *it, isSuccess, *myAppearance, myHasAppearance ) ) { continue; }
                if ( importElement( message, *it, isSuccess, *myMusicFont, myHasMusicFont ) ) { continue; }
                if ( importElement( message, *it, isSuccess, *myWordFont, myHasWordFont ) ) { continue; }
                importElementSet( message, it, endIter, isSuccess, "lyric-font", myLyricFontSet );
                importElementSet( message, it, endIter, isSuccess, "lyric-language", myLyricLanguageSet );
            }

            MX_RETURN_IS_SUCCESS;
        }
        bool Direction::fromXElementImpl( std::ostream& message, xml::XElement& xelement )
        {
            bool isSuccess = true;
            bool isDirectionTypeFound = false;
            isSuccess &= myAttributes->fromXElement( message, xelement );

            auto endIter = xelement.end();
            for( auto it = xelement.begin(); it != endIter; ++it )
            {
                if ( importDirectionTypeSet( message, it, endIter, isSuccess, isDirectionTypeFound ) ) { continue; }
                if ( importElement( message, *it, isSuccess, *myOffset, myHasOffset ) ) { continue; }
                importGroup( message, it, endIter, isSuccess, myEditorialVoiceDirectionGroup );
                if ( importElement( message, *it, isSuccess, *myStaff, myHasStaff ) ) { continue; }
                if ( importElement( message, *it, isSuccess, *mySound, myHasSound ) ) { continue; }
            }

            MX_RETURN_IS_SUCCESS;
        }
Esempio n. 6
0
int import( void *parent,void **v,void *pt) {
  int ret=1,GrpId,k;
  DIALOG D;
  DIA *d=NULL;
  D.VerId=1401010200;
  kgInitUi(&D);
  D.d=NULL;
  GrpId = importGroup(&D,v,pt);
  d = D.d;
  D.d = d;
  D.bkup = 1; /* set to 1 for backup */
  D.bor_type = 4;
  D.df = 3;
  D.tw = 4;
  D.bw = 4;
  D.lw = 4;
  D.rw = 4;
  D.xo = 10;   /* Position of Dialog */ 
  D.yo = 10;
  D.xl = 967;    /*  Length of Dialog */
  D.yl = 521;    /*  Width  of Dialog */
  D.Initfun = importinit;    /*   init fuction for Dialog */
  D.Cleanupfun = importcleanup;    /*   init fuction for Dialog */
  D.kbattn = 0;    /*  1 for drawing keyborad attention */
  D.butattn = 0;    /*  1 for drawing button attention */
  D.fullscreen = 0;    /*  1 for for fullscreen mode */
  D.Deco = 1;    /*  1 for Window Decorration */
  D.transparency = 0.000000;    /*  float 1.0 for full transparency */
  D.Newwin = 0;    /*  1 for new window not yet implemented */
  D.DrawBkgr = 1;    /*  1 for drawing background */
  D.Bkpixmap = NULL;    /*  background image */
  D.Sticky = 0;    /*  1 for stickyness */
  D.Resize = 0;    /*  1 for Resize option */
  D.MinWidth = 100;    /*   for Resize option */
  D.MinHeight = 100;    /*   for Resize option */
#if 1 
  D.Callback = importCallBack;    /*  default callback */
#else 
  D.Callback = NULL;    
#endif
  D.ResizeCallback = importResizeCallBack;  /*  Resize callback */
#if 1 
  D.WaitCallback = NULL;  /*  Wait callback */
#else 
  D.WaitCallback = importWaitCallBack;  /*  Wait callback */
#endif
  D.Fixpos = 1;    /*  1 for Fixing Position */
  D.NoTaskBar = 0;    /*  1 for not showing in task bar*/
  D.StackPos = 0;    /* -1,0,1 for for Stack Position -1:below 0:normal 1:above*/
  D.Shapexpm = NULL;    /*  PNG/jpeg file for window shape;Black color will not be drawn */
  D.parent = parent;    /*  1 for not showing in task bar*/
  D.pt = pt;    /*  any data to be passed by user*/
  strcpy(D.name,"Kulina Launcher: Import");    /*  Dialog name you may change */
  if(D.fullscreen!=1) {    /*  if not fullscreen mode */
     int xres,yres; 
     kgDisplaySize(&xres,&yres); 
      // D.xo=D.yo=0; D.xl = xres-10; D.yl=yres-80;
  }
  else {    // for fullscreen
     int xres,yres; 
     kgDisplaySize(&xres,&yres); 
     D.xo=D.yo=0; D.xl = xres; D.yl=yres;
//     D.StackPos = 1; // you may need it
  }    /*  end of fullscreen mode */
//  kgColorTheme(&D,210,210,210);    /*  set colors for gui*/
//  ModifyimportGc(&(D.gc));    /*  set colors for gui*/
  ret= kgUi(&D);
  kgCleanUi(&D);
  return ret;
}
 bool Metronome::fromXElementImpl( std::ostream& message, xml::XElement& xelement )
 {
     bool isSuccess = true;
     isSuccess &= myAttributes->fromXElement( message, xelement );
     
     auto iter = xelement.begin();
     auto endIter = xelement.end();
     
     for( ; iter != endIter; ++iter )
     {
         bool isIterIncremented = false;
         
         if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) )
         {
             myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::beatUnitPer );
             auto beatUnitGroup = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getBeatUnitGroup();
             importGroup( message, iter, endIter, isSuccess, beatUnitGroup );
             isIterIncremented = true;
             ++iter;
             
             if( iter == endIter )
             {
                 return false;
             }
             
             if( ( iter->getName() == "beat-unit" ) || ( iter->getName() == "beat-unit-dot" ) )
             {
                 auto beatUnitGroup2 = myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getBeatUnitGroup();
                 myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::beatUnitGroup );
                 importGroup( message, iter, endIter, isSuccess, beatUnitGroup2 );
                 isIterIncremented = true;
                 ++iter;
             }
             else if ( iter->getName() == "per-minute" )
             {
                 myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->setChoice( PerMinuteOrBeatUnitChoice::Choice::perMinute );
                 myBeatUnitPerOrNoteRelationNoteChoice->getBeatUnitPer()->getPerMinuteOrBeatUnitChoice()->getPerMinute()->fromXElement( message, *iter );
                 isIterIncremented = true;
                 ++iter;
             }
         }
         else if( ( iter->getName() == "metronome-note" ) )
         {
             myBeatUnitPerOrNoteRelationNoteChoice->setChoice( BeatUnitPerOrNoteRelationNoteChoice::Choice::noteRelationNote );
             auto noteRelationNote = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote();
             bool isFirstMetronomeNoteAdded = false;
             
             while( iter != endIter && iter->getName() == "metronome-note" )
             {
                 auto metronomeNote = makeMetronomeNote();
                 isSuccess &= metronomeNote->fromXElement( message, *iter );
                 
                 if( !isFirstMetronomeNoteAdded && noteRelationNote->getMetronomeNoteSet().size() == 1 )
                 {
                     noteRelationNote->addMetronomeNote( metronomeNote );
                     noteRelationNote->removeMetronomeNote( noteRelationNote->getMetronomeNoteSet().cbegin() );
                     isFirstMetronomeNoteAdded = true;
                 }
                 else
                 {
                     noteRelationNote->addMetronomeNote( metronomeNote );
                     isFirstMetronomeNoteAdded = true;
                 }
                 isIterIncremented = true;
                 ++iter;
             }
             
             if( iter == endIter )
             {
                 MX_RETURN_IS_SUCCESS;
             }
             
             if( iter->getName() == "metronome-relation" )
             {
                 myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true );
                 auto metronomeRelationGroup = myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->getMetronomeRelationGroup();
                 isSuccess &= metronomeRelationGroup->getMetronomeRelation()->fromXElement( message, *iter );
                 ++iter;
                 isIterIncremented = true;
                 
                 if( iter == endIter )
                 {
                     MX_RETURN_IS_SUCCESS;
                 }
                 
                 if( iter->getName() == "metronome-note" )
                 {
                     myBeatUnitPerOrNoteRelationNoteChoice->getNoteRelationNote()->setHasMetronomeRelationGroup( true );
                     isSuccess &= metronomeRelationGroup->getMetronomeNote()->fromXElement( message, *iter );
                     ++iter;
                     isIterIncremented = true;
                     if( iter == endIter )
                     {
                         MX_RETURN_IS_SUCCESS;
                     }
                 }
             }
             
         }
         
         if( isIterIncremented )
         {
             --iter;
         }
     }
     
     MX_RETURN_IS_SUCCESS;
 }