Fresco/Fresco-C++-demos/src EditTextDemo.cc,1.13,1.14 TextDemo.cc,1.10,1.11 demo.cc,1.23,1.24 pinyin_demo.cc,1.17,1.18
Tobias Hunger <[email protected]> Fri, 01 Aug 2003 11:47:23 -0500
| Newsgroups | gmane.comp.video.fresco.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/fresco/Fresco/Fresco-C++-demos/src In directory purcel:/tmp/cvs-serv24256/Fresco-C++-demos/src Modified Files: EditTextDemo.cc TextDemo.cc demo.cc pinyin_demo.cc Log Message: Babylon work over: * Use iconv to convert characters to/from Babylon * Updtae to Unicode Version 4.0 * Added unit tests (some fail for now, still need to work on that) * Removed the VisualTextBuffer from the CommandKit: I still like the idea, unfortunately it won't work out in the real world:-| * Updated code to the changed Babylon interfaces whereever needed. Index: EditTextDemo.cc =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/EditTextDemo.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- EditTextDemo.cc 8 Oct 2002 18:21:23 -0000 1.13 +++ EditTextDemo.cc 1 Aug 2003 16:47:20 -0000 1.14 @@ -1,4 +1,4 @@ - /*$Id$ +/*$Id$ * * This source file is a part of the Fresco Project. * Copyright (C) 1999 Stefan Seefeld <[email protected]> @@ -44,14 +44,13 @@ 0xad6d, 0xc5b4 }; - Babylon::String str(34, chars); + Babylon::String str(chars, 34); TextBuffer_var buf = commands->text(); - TextBuffer_var vis_buf = buf->get_visual_buffer(); - Graphic_var txt = text->simple_viewer(vis_buf); + Graphic_var txt = text->simple_viewer(buf); ToolKit::FrameSpec spec; spec.brightness(0.5); spec._d(ToolKit::inset); Graphic_var frame = tools->frame(Graphic_var(layout->margin(Graphic_var(layout->hfixed(Graphic_var(tools->rgb(txt, 0., 0., 0.)), 4000)), 50.)), 20., spec, true); buf->insert_string(Unicode::to_CORBA(str)); - application->append(Controller_var(tools->text_input(frame, vis_buf)), Babylon::String("editable text")); + application->append(Controller_var(tools->text_input(frame, buf)), Babylon::String("editable text")); }; Index: TextDemo.cc =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/TextDemo.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TextDemo.cc 17 Nov 2002 13:14:24 -0000 1.10 +++ TextDemo.cc 1 Aug 2003 16:47:20 -0000 1.11 @@ -39,7 +39,7 @@ 0xad6d, 0xc5b4 }; - Babylon::String str(34, chars); + Babylon::String str(chars, 34); Graphic_var txt = text->chunk(Unicode::to_CORBA(str)); Controller_var group = tools->group(Graphic_var(tools->rgb(txt, 0.2, 0.3, 0.5))); application->append(group, Babylon::String("text")); Index: demo.cc =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/demo.cc,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- demo.cc 21 Dec 2002 04:18:38 -0000 1.23 +++ demo.cc 1 Aug 2003 16:47:20 -0000 1.24 @@ -95,7 +95,7 @@ std::auto_ptr<Demo> focus(create_demo<FocusDemo>(application)); std::auto_ptr<Demo> viewport(create_demo<ViewportDemo>(application)); std::auto_ptr<Demo> document(create_demo<DocDemo>(application)); - std::auto_ptr<Demo> terminal(create_demo<TermDemo>(application)); + // std::auto_ptr<Demo> terminal(create_demo<TermDemo>(application)); application->run(); delete application; Index: pinyin_demo.cc =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/pinyin_demo.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pinyin_demo.cc 14 Apr 2003 00:25:06 -0000 1.17 +++ pinyin_demo.cc 1 Aug 2003 16:47:21 -0000 1.18 @@ -47,6 +47,7 @@ #include <Fresco/TextBuffer.hh> #include <Babylon/Babylon.hh> +#include <Prague/Sys/Path.hh> #ifdef DATADIR const std::string data_dir = DATADIR; @@ -94,7 +95,7 @@ // I use insert_string() since the chinese chars might have // a codepoint above 0xFFFF which insert_char() is not // able to handle. - output->insert_string(Unicode::to_CORBA(Babylon::String(select_from[last.value() - 'A']))); + output->insert_string(Unicode::to_CORBA(Babylon::String(1, select_from[last.value() - 'A']))); //XXX input->clear(); // this clears select too: // it results in a call to this function