MakeInstall4 - ready for wine

git-svn-id: svn://ultimatepp.org/upp/trunk@958 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-03-14 13:41:05 +00:00
parent 7a14c82189
commit 30f52dfc8d
16 changed files with 401 additions and 2 deletions

View file

@ -0,0 +1,11 @@
uses
CtrlLib,
GLCtrl,
Painter;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,6 @@
#ifndef _PainterBench_icpp_init_stub
#define _PainterBench_icpp_init_stub
#include "CtrlLib/init"
#include "GLCtrl/init"
#include "Painter/init"
#endif

View file

@ -0,0 +1,140 @@
#include <GLCtrl/GLCtrl.h>
#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>
using namespace Upp;
#define LINE
struct PainterExample : Ctrl {
public:
double delta;
virtual void Paint(Draw &draw) {
delta=0;
ImageBuffer ib(draw.GetPagePixels());
BufferPainter pntr(ib);
dword begin=GetTickCount();
int reps=0;
for(reps=0;reps<5;reps++) for(int i=0;i<500;i++){
#ifdef LINE
pntr.Move(i,0).Line(499,i).Line(499-i,499).Line(0,499-i).Close().Stroke(4,Red());
#else
pntr.Move(i,0).Line(499,i).Line(499-i,499).Line(0,499-i).Close().Fill(Red());
#endif
}
dword end=GetTickCount();
delta=end-begin;
delta/=reps;
draw.DrawImage(0,0,ib);
}
};
struct DrawExample : Ctrl {
public:
double delta;
virtual void Paint(Draw &draw) {
delta=0;
dword begin=GetTickCount();
Rect rect(0,0,500,500);
int reps=0;
for(reps=0;reps<5;reps++) for(int i=0;i<500;i++){
Point v[5]={Point(i,0),Point(499,i),Point(499-i,499),Point(0,499-i),Point(i,0)};
#ifdef LINE
draw.DrawPolyline(v,5,4,Green());
#else
draw.DrawPolygon(v,5,Green());
#endif
}
dword end=GetTickCount();
delta=end-begin;
delta/=reps;
}
};
struct OpenGLExample : GLCtrl {
public:
double delta;
virtual void GLPaint() {
delta=0;
Size sz=GetSize();
dword begin=GetTickCount();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0,0,sz.cx,sz.cy);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glPushMatrix();
glOrtho(0,sz.cx,sz.cy,0,-1,1);
int reps=0;
for(reps=0;reps<10;reps++) for(int i=0;i<500;i++){
#ifdef LINE
glBegin(GL_LINE_STRIP); // Polyline
#else
glBegin(GL_POLYGON); // Polygon
#endif
glColor3f(0.0f,0.0f,1.0f); // Blue
glVertex2f((float)i,(float)0);
glVertex2f((float)499,(float)i);
glVertex2f((float)499-i,(float)499);
glVertex2f((float)0,(float)499-i);
glVertex2f((float)i,(float)0);
glEnd();
glFlush();
}
glPopMatrix();
glFlush();
dword end=GetTickCount();
delta=end-begin;
delta/=reps;
}
};
class ExampleTopWindow: public TopWindow{
public:
PainterExample pr;
DrawExample dw;
OpenGLExample gl;
ExampleTopWindow(){
pr.SetRect(0,0,500,500);
dw.SetRect(500,0,500,500);
gl.SetRect(1000,0,500,500);
pr.BackPaint();
dw.BackPaint();
gl.BackPaint();
pr.delta=0;
dw.delta=0;
gl.delta=0;
Add(pr);
Add(dw);
Add(gl);
}
virtual void LeftDown(Point p,dword keyflags){
Title(Format("Painter/Draw/OpenGL: %.3f/%.3f/%.3f ms",pr.delta,dw.delta,gl.delta));
Refresh();
}
};
GUI_APP_MAIN
{
ExampleTopWindow win;
win.Sizeable().Zoomable();
win.Open();
win.Run();
}

View file

@ -7,7 +7,7 @@ LAYOUT(InstallLayout, 292, 308)
ITEM(EditString, idedir, LeftPosZ(100, 184).TopPosZ(56, 19))
ITEM(Label, dv___6, SetLabel(t_("MinGWI directory")).LeftPosZ(8, 88).TopPosZ(80, 19))
ITEM(EditString, mingw, LeftPosZ(100, 184).TopPosZ(80, 19))
ITEM(Label, dv___8, SetLabel(t_("U++ VERSION")).SetFont(StdFont(11).Bold()).LeftPosZ(8, 88).TopPosZ(120, 19))
ITEM(Label, dv___8, SetLabel(t_("U++ VERSION")).SetFont(StdFontZ(11).Bold()).LeftPosZ(8, 88).TopPosZ(120, 19))
ITEM(EditString, version, LeftPosZ(100, 184).TopPosZ(120, 19))
ITEM(Option, make_mingw, SetLabel(t_("Create upp-mingw")).LeftPosZ(12, 216).TopPosZ(164, 15))
ITEM(Option, make_win, SetLabel(t_("Create upp-win")).LeftPosZ(12, 216).TopPosZ(184, 15))

View file

@ -1 +1 @@
1112 RCDATA MOVEABLE PURE "c:\\Dev\\upp.install.final\\upp-mingw.7z"
1112 RCDATA MOVEABLE PURE "u:\\upp.tmp\\upp.7z"

View file

@ -26,6 +26,7 @@ file
PixFmts.h,
AggCtrl.h,
AggCtrlWin32.cpp,
Test.cpp,
AggCtrlX11.cpp;
mainconfig

150
uppdev/AggCtrl/Test.cpp Normal file
View file

@ -0,0 +1,150 @@
#include "CtrlLib.h"
NAMESPACE_UPP
DropChoice::DropChoice() {
always_drop = false;
AddButton().Main() <<= THISBACK(Drop);
NoDisplay();
list.Normal();
list.WhenSelect = callback(this, &DropChoice::Select);
dropfocus = true;
EnableDrop(false);
dropwidth = 0;
}
void DropChoice::EnableDrop(bool b)
{
MainButton().Enable(b);
}
void DropChoice::PseudoPush()
{
MultiButton::PseudoPush(0);
}
void DropChoice::Drop() {
if(!owner || owner->IsReadOnly() || list.GetCount() == 0 && !WhenDrop) return;
WhenDrop();
if(dropfocus)
owner->SetWantFocus();
if(!list.FindSetCursor(owner->GetData()) && list.GetCount() > 0)
list.SetCursor(0);
list.PopUp(owner,dropwidth);
}
void DropChoice::Select() {
if(!owner || owner->IsReadOnly()) return;
WhenSelect();
}
Value DropChoice::Get() const {
if(!owner || owner->IsReadOnly()) return Value();
int c = list.GetCursor();
if(c < 0) return Value();
return list.Get(c, 0);
}
int DropChoice::GetIndex() const
{
if(!owner || owner->IsReadOnly()) return -1;
return list.GetCursor();
}
bool DropChoice::DataSelect(Ctrl& owner, DropChoice& drop, const String& appends) {
Value g = drop.Get();
if(g.IsVoid()) return false;
Value s = owner.GetData();
if(!appends.IsVoid()) {
String txt = s;
if(!txt.IsEmpty()) txt.Cat(appends);
txt.Cat((String)g);
s = txt;
}
else
s = g;
owner.SetData(s);
owner.WhenAction();
return true;
}
bool DropChoice::DoKey(dword key) {
if(owner && !owner->IsReadOnly() && list.GetCount()) {
int q = list.GetCursor();
switch(key) {
case K_ALT_DOWN:
PseudoPush();
return true;
case K_DOWN:
if(appending)
PseudoPush();
else {
list.SetCursor(q <= 0 ? list.GetCount() - 1 : q - 1);
Select();
}
return true;
case K_UP:
if(appending)
PseudoPush();
else {
list.SetCursor(q < 0 || q >= list.GetCount() - 1 ? 0 : q + 1);
Select();
}
return true;
}
}
return false;
}
void DropChoice::Add(const Value& s) {
list.Add(s);
EnableDrop(true);
}
void DropChoice::Clear() {
list.Clear();
EnableDrop(always_drop);
}
void DropChoice::Serialize(Stream& s) {
int version = 0x00;
int n = list.GetCount();
s / version / n;
Value v;
if(s.IsLoading()) {
Clear();
for(int i = 0; i < n; i++) {
s % v;
Add(v);
}
}
else
for(int i = 0; i < n; i++) {
v = list.Get(i, 0);
s % v;
}
EnableDrop(list.GetCount() || always_drop);
}
void DropChoice::AddHistory(const Value& v, int max) {
if(IsNull(v)) return;
for(int i = 0; i < list.GetCount(); i++)
if(list.Get(i, 0) == v) {
list.Remove(i);
break;
}
list.Insert(0, Vector<Value>() << v);
if(list.GetCount() > max)
list.SetCount(max);
EnableDrop(list.GetCount() || always_drop);
list.KillCursor();
}
DropChoice& DropChoice::AlwaysDrop(bool e)
{
always_drop = e;
EnableDrop(list.GetCount() || always_drop);
return *this;
}
END_UPP_NAMESPACE

View file

@ -0,0 +1,6 @@
#include <Core/Core.h>
namespace Upp {
};

View file

@ -0,0 +1,9 @@
uses
Core;
file
CondVar.cpp;
mainconfig
"" = "MT";

4
uppdev/CondVar/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _CondVar_icpp_init_stub
#define _CondVar_icpp_init_stub
#include "Core/init"
#endif

View file

@ -0,0 +1,10 @@
uses
CtrlLib,
TextDiffCtrl;
file
main.cpp;
mainconfig
"" = "GUI";

5
uppdev/TextDiff/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _TextDiff_icpp_init_stub
#define _TextDiff_icpp_init_stub
#include "CtrlLib/init"
#include "TextDiffCtrl/init"
#endif

12
uppdev/TextDiff/main.cpp Normal file
View file

@ -0,0 +1,12 @@
#include <TextDiffCtrl/TextDiffCtrl.h>
using namespace Upp;
GUI_APP_MAIN
{
TopWindow win;
TextDiffCtrl ctrl;
win.Add(ctrl.SizePos());
ctrl.Set(LoadFile("u:/file1.txt"), LoadFile("u:/file2.txt"));
win.Run();
}

4
uppsrc/assemblies Normal file
View file

@ -0,0 +1,4 @@
examples
reference
tutorial
bazaar

38
uppsrc/packages Normal file
View file

@ -0,0 +1,38 @@
BuildAll
CbGen
CodeEditor
coff
Core
CppBase
Crypto
CtrlCore
CtrlLib
Draw
DropGrid
Esc
Geom
GLCtrl
GridCtrl
HexView
IconDes
ide
MySql
Ole
OleDB
Oracle
PdfDraw
plugin
PostgreSQL
Report
RichEdit
RichText
Sql
SqlCommander
SqlCtrl
umk
Updater
TextDiffCtrl
ODBC
usvn
art
Painter

3
uppsrc/packages1 Normal file
View file

@ -0,0 +1,3 @@
Web
Web/TServ
Web/SSL