예제 #1
0
파일: PlEx.cpp 프로젝트: ackalker/eaglemode
PlExFileModel::PlExFileModel(emContext & context, const emString & name)
	: emRecFileModel(context,name), emStructRec(),
	CurrentColor(this,"CurrentColor"),
	Lines(this,"Lines")
{
	PostConstruct(*this);
}
예제 #2
0
emCoreConfig::emCoreConfig(emContext & context, const emString & name)
	: emConfigModel(context,name),
	emStructRec(),
	StickMouseWhenNavigating(this,"StickMouseWhenNavigating",false),
	EmulateMiddleButton(this,"EmulateMiddleButton",false),
	PanFunction(this,"PanFunction",false),
	MouseZoomSpeedFactor(this,"MouseZoomSpeedFactor",1.0,0.25,4.0),
	MouseFineZoomSpeedFactor(this,"MouseFineZoomSpeedFactor",1.0,0.25,4.0),
	MouseScrollSpeedFactor(this,"MouseScrollSpeedFactor",1.0,0.25,4.0),
	MouseFineScrollSpeedFactor(this,"MouseFineScrollSpeedFactor",1.0,0.25,4.0),
	WheelZoomSpeedFactor(this,"WheelZoomSpeedFactor",1.0,0.25,4.0),
	WheelFineZoomSpeedFactor(this,"WheelFineZoomSpeedFactor",1.0,0.25,4.0),
	KeyboardZoomSpeedFactor(this,"KeyboardZoomSpeedFactor",1.0,0.25,4.0),
	KeyboardFineZoomSpeedFactor(this,"KeyboardFineZoomSpeedFactor",1.0,0.25,4.0),
	KeyboardScrollSpeedFactor(this,"KeyboardScrollSpeedFactor",1.0,0.25,4.0),
	KeyboardFineScrollSpeedFactor(this,"KeyboardFineScrollSpeedFactor",1.0,0.25,4.0),
	MaxMegabytesPerView(
		this,"MaxMegabytesPerView",
#if defined(ANDROID)
		64,
#else
		512,
#endif
		8,16384
	)
{
	PostConstruct(
		*this,
		emGetInstallPath(EM_IDT_USER_CONFIG,"emCore","config.rec")
	);
	LoadOrInstall();
}
예제 #3
0
파일: lterra.cpp 프로젝트: AdrianGin/ivan
void lterrain::Initialize(int NewConfig, int SpecialFlags)
{
  if(!(SpecialFlags & LOAD))
  {
    InstallDataBase(NewConfig);
    RandomizeVisualEffects();

    if(!(SpecialFlags & NO_MATERIALS))
      GenerateMaterials();
  }

  if(!(SpecialFlags & LOAD))
  {
    PostConstruct();
    RestoreHP();
  }

  if(!(SpecialFlags & LOAD))
  {
    if(!(SpecialFlags & NO_MATERIALS))
    {
      CalculateAll();

      if(!(SpecialFlags & NO_PIC_UPDATE))
        UpdatePictures();
    }
  }
}
UEnum* FEnumArchiveProxy::CreateEnum(const FUHTMakefile& UHTMakefile) const
{
	UObject* Outer = UHTMakefile.GetObjectByIndex(OuterIndex);

	// Create enum definition.
	UEnum* Enum = new(EC_InternalUseOnlyConstructor, Outer, Name.CreateName(UHTMakefile), (EObjectFlags)ObjectFlagsUint32) UEnum(FObjectInitializer());
	PostConstruct(Enum, UHTMakefile);
	return Enum;
}
예제 #5
0
emMinesFileModel::emMinesFileModel(emContext & context, const emString & name)
	: emRecFileModel(context,name),
	emStructRec(),
	SizeX(this,"SizeX",1,1,20),
	SizeY(this,"SizeY",1,1,20),
	SizeZ(this,"SizeZ",1,1,20),
	Fields(this,"Fields",1,20*20*20)
{
	ExtraDataValid=false;
	PostConstruct(*this);
	SetListenedRec(this);
}
UClass* FClassArchiveProxy::CreateClass(const FUHTMakefile& UHTMakefile) const
{
    UObject* Outer = UHTMakefile.GetObjectByIndex(OuterIndex);
    FName ClassName = Name.CreateName(UHTMakefile);
    UClass* Class = FindObject<UClass>(Outer, *ClassName.ToString());
    if (Class == nullptr || !Class->HasAnyClassFlags(CLASS_Native))
    {
        Class = new(EC_InternalUseOnlyConstructor, Outer, ClassName, (EObjectFlags)ObjectFlagsUint32) UClass(FObjectInitializer(), nullptr);
    }
    PostConstruct(Class);

    return Class;
}
예제 #7
0
emFileManTheme::emFileManTheme(emContext & context, const emString & name)
	: emConfigModel(context,name),
	emStructRec(),
	DisplayName(this,"DisplayName"),
	BackgroundColor(this,"BackgroundColor"),
	SourceSelectionColor(this,"SourceSelectionColor"),
	TargetSelectionColor(this,"TargetSelectionColor"),
	NormalNameColor(this,"NormalNameColor"),
	ExeNameColor(this,"ExeNameColor"),
	DirNameColor(this,"DirNameColor"),
	FifoNameColor(this,"FifoNameColor"),
	BlkNameColor(this,"BlkNameColor"),
	ChrNameColor(this,"ChrNameColor"),
	SockNameColor(this,"SockNameColor"),
	OtherNameColor(this,"OtherNameColor"),
	PathColor(this,"PathColor"),
	SymLinkColor(this,"SymLinkColor"),
	LabelColor(this,"LabelColor"),
	InfoColor(this,"InfoColor"),
	FileContentColor(this,"FileContentColor"),
	DirContentColor(this,"DirContentColor"),
	Height(this,"Height"),
	BackgroundX(this,"BackgroundX"),
	BackgroundY(this,"BackgroundY"),
	BackgroundW(this,"BackgroundW"),
	BackgroundH(this,"BackgroundH"),
	BackgroundRX(this,"BackgroundRX"),
	BackgroundRY(this,"BackgroundRY"),
	OuterBorderX(this,"OuterBorderX"),
	OuterBorderY(this,"OuterBorderY"),
	OuterBorderW(this,"OuterBorderW"),
	OuterBorderH(this,"OuterBorderH"),
	OuterBorderL(this,"OuterBorderL"),
	OuterBorderT(this,"OuterBorderT"),
	OuterBorderR(this,"OuterBorderR"),
	OuterBorderB(this,"OuterBorderB"),
	OuterBorderImg(this,"OuterBorderImg",GetRootContext()),
	OuterBorderImgL(this,"OuterBorderImgL"),
	OuterBorderImgT(this,"OuterBorderImgT"),
	OuterBorderImgR(this,"OuterBorderImgR"),
	OuterBorderImgB(this,"OuterBorderImgB"),
	NameX(this,"NameX"),
	NameY(this,"NameY"),
	NameW(this,"NameW"),
	NameH(this,"NameH"),
	NameAlignment(this,"NameAlignment"),
	PathX(this,"PathX"),
	PathY(this,"PathY"),
	PathW(this,"PathW"),
	PathH(this,"PathH"),
	PathAlignment(this,"PathAlignment"),
	InfoX(this,"InfoX"),
	InfoY(this,"InfoY"),
	InfoW(this,"InfoW"),
	InfoH(this,"InfoH"),
	InfoAlignment(this,"InfoAlignment"),
	FileInnerBorderX(this,"FileInnerBorderX"),
	FileInnerBorderY(this,"FileInnerBorderY"),
	FileInnerBorderW(this,"FileInnerBorderW"),
	FileInnerBorderH(this,"FileInnerBorderH"),
	FileInnerBorderL(this,"FileInnerBorderL"),
	FileInnerBorderT(this,"FileInnerBorderT"),
	FileInnerBorderR(this,"FileInnerBorderR"),
	FileInnerBorderB(this,"FileInnerBorderB"),
	FileInnerBorderImg(this,"FileInnerBorderImg",GetRootContext()),
	FileInnerBorderImgL(this,"FileInnerBorderImgL"),
	FileInnerBorderImgT(this,"FileInnerBorderImgT"),
	FileInnerBorderImgR(this,"FileInnerBorderImgR"),
	FileInnerBorderImgB(this,"FileInnerBorderImgB"),
	FileContentX(this,"FileContentX"),
	FileContentY(this,"FileContentY"),
	FileContentW(this,"FileContentW"),
	FileContentH(this,"FileContentH"),
	DirInnerBorderX(this,"DirInnerBorderX"),
	DirInnerBorderY(this,"DirInnerBorderY"),
	DirInnerBorderW(this,"DirInnerBorderW"),
	DirInnerBorderH(this,"DirInnerBorderH"),
	DirInnerBorderL(this,"DirInnerBorderL"),
	DirInnerBorderT(this,"DirInnerBorderT"),
	DirInnerBorderR(this,"DirInnerBorderR"),
	DirInnerBorderB(this,"DirInnerBorderB"),
	DirInnerBorderImg(this,"DirInnerBorderImg",GetRootContext()),
	DirInnerBorderImgL(this,"DirInnerBorderImgL"),
	DirInnerBorderImgT(this,"DirInnerBorderImgT"),
	DirInnerBorderImgR(this,"DirInnerBorderImgR"),
	DirInnerBorderImgB(this,"DirInnerBorderImgB"),
	DirContentX(this,"DirContentX"),
	DirContentY(this,"DirContentY"),
	DirContentW(this,"DirContentW"),
	DirContentH(this,"DirContentH"),
	AltX(this,"AltX"),
	AltY(this,"AltY"),
	AltW(this,"AltW"),
	AltH(this,"AltH"),
	AltLabelX(this,"AltLabelX"),
	AltLabelY(this,"AltLabelY"),
	AltLabelW(this,"AltLabelW"),
	AltLabelH(this,"AltLabelH"),
	AltLabelAlignment(this,"AltLabelAlignment"),
	AltPathX(this,"AltPathX"),
	AltPathY(this,"AltPathY"),
	AltPathW(this,"AltPathW"),
	AltPathH(this,"AltPathH"),
	AltPathAlignment(this,"AltPathAlignment"),
	AltAltX(this,"AltAltX"),
	AltAltY(this,"AltAltY"),
	AltAltW(this,"AltAltW"),
	AltAltH(this,"AltAltH"),
	AltInnerBorderX(this,"AltInnerBorderX"),
	AltInnerBorderY(this,"AltInnerBorderY"),
	AltInnerBorderW(this,"AltInnerBorderW"),
	AltInnerBorderH(this,"AltInnerBorderH"),
	AltInnerBorderL(this,"AltInnerBorderL"),
	AltInnerBorderT(this,"AltInnerBorderT"),
	AltInnerBorderR(this,"AltInnerBorderR"),
	AltInnerBorderB(this,"AltInnerBorderB"),
	AltInnerBorderImg(this,"AltInnerBorderImg",GetRootContext()),
	AltInnerBorderImgL(this,"AltInnerBorderImgL"),
	AltInnerBorderImgT(this,"AltInnerBorderImgT"),
	AltInnerBorderImgR(this,"AltInnerBorderImgR"),
	AltInnerBorderImgB(this,"AltInnerBorderImgB"),
	AltContentX(this,"AltContentX"),
	AltContentY(this,"AltContentY"),
	AltContentW(this,"AltContentW"),
	AltContentH(this,"AltContentH"),
	MinContentVW(this,"MinContentVW"),
	MinAltVW(this,"MinAltVW")
{
	PostConstruct(
		*this,
		emGetChildPath(GetThemesDirPath(), name + ThemeFileEnding)
	);
	LoadOrInstall();
}
예제 #8
0
bool emX11WindowPort::Cycle()
{
	XWindowAttributes attr;
	XSizeHints xsh;
	emString str;
	emCursor cur;
	::Window win;
	::Cursor xcur;
	emX11WindowPort * wp;
	double vrx,vry,vrw,vrh,fx,fy,fw,fh;
	int i,x,y,w,h;
	Status xs;

	if (
		FullscreenUpdateTimer &&
		IsSignaled(FullscreenUpdateTimer->GetSignal())
	) {
		Screen.GetVisibleRect(&vrx,&vry,&vrw,&vrh);
		if (
			fabs(PaneX-vrx)>0.51 || fabs(PaneY-vry)>0.51 ||
			fabs(PaneW-vrw)>0.51 || fabs(PaneH-vrh)>0.51
		) {
			PosForced=true;
			PosPending=true;
			SizeForced=true;
			SizePending=true;
			SetViewGeometry(vrx,vry,vrw,vrh,Screen.PixelTallness);
		}

		// Workaround for lots of focus problems with several window managers:
		if (Screen.GrabbingWinPort==this) {
			XMutex.Lock();
			XGetInputFocus(Disp,&win,&i);
			XMutex.Unlock();
			wp=NULL;
			for (i=Screen.WinPorts.GetCount()-1; i>=0; i--) {
				if (Screen.WinPorts[i]->Win==win) {
					wp=Screen.WinPorts[i];
					break;
				}
			}
			if (wp==this) {
				if (!Focused) {
					Focused=true;
					SetViewFocused(true);
					emWarning("emX11WindowPort: Focus workaround 1 applied.");
				}
			}
			else {
				while (wp) {
					if (wp==this) break;
					wp=wp->Owner;
				}
				if (!wp) {
					XMutex.Lock();
					xs=XGetWindowAttributes(Disp,Win,&attr);
					XMutex.Unlock();
					if (xs && attr.map_state==IsViewable) {
						XMutex.Lock();
						XSetInputFocus(Disp,Win,RevertToNone,CurrentTime);
						XMutex.Unlock();
						emWarning("emX11WindowPort: Focus workaround 2 applied.");
					}
				}
			}
		}
	}

	if (
		!PostConstructed && !PosForced && Owner &&
		(GetWindowFlags()&emWindow::WF_FULLSCREEN)==0
	) {
		Screen.GetVisibleRect(&vrx,&vry,&vrw,&vrh);
		fx=Owner->GetViewX()-Owner->BorderL;
		fy=Owner->GetViewY()-Owner->BorderT;
		fw=Owner->GetViewWidth()+Owner->BorderL+Owner->BorderR;
		fh=Owner->GetViewHeight()+Owner->BorderT+Owner->BorderB;
		fx+=fw*0.5;
		fy+=fh*0.5;
		fw=GetViewWidth()+BorderL+BorderR;
		fh=GetViewHeight()+BorderT+BorderB;
		fx-=fw*0.5+emGetDblRandom(-0.03,0.03)*vrw;
		fy-=fh*0.5+emGetDblRandom(-0.03,0.03)*vrh;
		if (fx>vrx+vrw-fw) fx=vrx+vrw-fw;
		if (fy>vry+vrh-fh) fy=vry+vrh-fh;
		if (fx<vrx) fx=vrx;
		if (fy<vry) fy=vry;
		SetViewGeometry(
			fx+BorderL,fy+BorderT,
			GetViewWidth(),GetViewHeight(),
			Screen.PixelTallness
		);
		PosPending=true;
		PosForced=true;
	}

	if (PosPending || SizePending) {
		x=((int)GetViewX())-BorderL;
		y=((int)GetViewY())-BorderT;
		w=(int)GetViewWidth();
		h=(int)GetViewHeight();
		memset(&xsh,0,sizeof(xsh));
		xsh.flags     =PMinSize;
		xsh.min_width =MinPaneW;
		xsh.min_height=MinPaneH;
		if (PosForced) {
			xsh.flags|=PPosition|USPosition;
			xsh.x=x;
			xsh.y=y;
		}
		if (SizeForced) {
			xsh.flags|=PSize|USSize;
			xsh.width=w;
			xsh.height=h;
		}
		XMutex.Lock();
		XSetWMNormalHints(Disp,Win,&xsh);
		if (PosPending && SizePending) {
			XMoveResizeWindow(Disp,Win,x,y,w,h);
		}
		else if (PosPending) {
			XMoveWindow(Disp,Win,x,y);
		}
		else {
			XResizeWindow(Disp,Win,w,h);
		}
		XMutex.Unlock();
		PosPending=false;
		SizePending=false;
	}

	if (TitlePending) {
		str=GetWindowTitle();
		if (Title!=str) {
			Title=str;
			XMutex.Lock();
			XmbSetWMProperties(Disp,Win,Title.Get(),NULL,NULL,0,NULL,NULL,NULL);
			XMutex.Unlock();
		}
		TitlePending=false;
	}

	if (IconPending) {
		SetIconProperty(GetWindowIcon());
		IconPending=false;
	}

	if (CursorPending) {
		cur=GetViewCursor();
		if (Cursor!=cur) {
			Cursor=cur;
			xcur=Screen.GetXCursor(cur);
			XMutex.Lock();
			XDefineCursor(Disp,Win,xcur);
			XMutex.Unlock();
		}
		CursorPending=false;
	}

	if (!PostConstructed) {
		PostConstruct();
		PostConstructed=true;
	}

	if (!InvalidRects.IsEmpty() && Mapped) {
		UpdatePainting();
		if (!LaunchFeedbackSent) {
			LaunchFeedbackSent=true;
			SendLaunchFeedback();
		}
	}

	return false;
}
UObjectBase* FObjectBaseArchiveProxy::CreateObjectBase(const FUHTMakefile& UHTMakefile) const
{
	UObjectBase* ObjectBase = new UObjectBase(nullptr, EObjectFlags(ObjectFlagsUint32), EInternalObjectFlags::Native, nullptr, Name.CreateName(UHTMakefile));
	PostConstruct(ObjectBase);
	return ObjectBase;
}