libufo-commits Mailing List for UFO: Universal Form Objects (Page 2)
Status: Beta
Brought to you by:
schmidtjf
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
(78) |
Oct
(69) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Johannes S. <sch...@us...> - 2005-10-27 14:31:00
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8321/src/widgets Modified Files: ubutton.cpp Log Message: Allow non-radio buttons in button groups to be deselected. Index: ubutton.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/ubutton.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ubutton.cpp 30 Sep 2005 12:37:20 -0000 1.25 --- ubutton.cpp 27 Oct 2005 14:30:52 -0000 1.26 *************** *** 228,232 **** if (isToggable()) { if (m_buttonGroup) { ! m_buttonGroup->setSelectedButton(this, true); } else { setSelected(!isSelected()); --- 228,232 ---- if (isToggable()) { if (m_buttonGroup) { ! m_buttonGroup->setSelectedButton(this, !isSelected()); } else { setSelected(!isSelected()); |
|
From: Johannes S. <sch...@us...> - 2005-10-26 13:41:34
|
Update of /cvsroot/libufo/ufo-0.5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21970 Modified Files: ChangeLog TODO Log Message: Index: TODO =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TODO 18 Apr 2004 12:46:12 -0000 1.3 --- TODO 26 Oct 2005 13:41:14 -0000 1.4 *************** *** 2,8 **** More immediate - Write an up-to-date TODO file Less immediate ! - Use optimized methods for image(-filter) methods (like memcpy) - Remove deprecated code --- 2,12 ---- More immediate - Write an up-to-date TODO file + - Write new paint engine (picasso) + - Merge UVideoDevice with UXFrame (and UContext?) + - Add Unicode (UTF-8?) support + - Add D3D rendering backend Less immediate ! - Add Tree/Table widget - Remove deprecated code Index: ChangeLog =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/ChangeLog,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ChangeLog 11 Oct 2005 20:23:30 -0000 1.37 --- ChangeLog 26 Oct 2005 13:41:14 -0000 1.38 *************** *** 901,902 **** --- 901,917 ---- - Changed GL graphics to have an 0.5f offset for lines rasterization (removed general 3/8 pixel offset). + + 0.8.4 + - Made code relocatable (thanks to autopackage.org) + - Added UFileArchive::isDirectory, UFileArchive::dirName + - Removed UFileArchive::createFileStream, destroyFileStream + - Fixed alpha value for colors returned by UColor::brighter,darker + - Fixed clean-up on destruction of glx driver + - Changed UWidget::removeImpl(iterator) to UWidget::removeImpl(int index) + - Made UWidget::testState,setState(s),getState public + - Fixed bug with unreferencing UVolatileData in UAbstractDisplay + - Changed UVolatileData to auto-registering at UDisplay. + - Fixed colored vertex arrays (in UGL_Graphics and UVertexArray). + - Fixed UBoxLayout::getPreferredSize for implicitely hidden widgets. + - Fixed clean-up of ugl_driver in dummy video driver. + - Implemented XUL elements: groupbox, deck, stack and tabbox |
|
From: Johannes S. <sch...@us...> - 2005-10-26 12:09:16
|
Update of /cvsroot/libufo/ufo-0.5/src/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3536/src/ui Modified Files: ubasicstyle.cpp Log Message: Fixed PE_PanelButtonBevel. Index: ubasicstyle.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/ui/ubasicstyle.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ubasicstyle.cpp 24 Oct 2005 16:02:13 -0000 1.9 --- ubasicstyle.cpp 26 Oct 2005 12:09:07 -0000 1.10 *************** *** 273,278 **** UVertexArray bg; bg.setColor(col.brighter()); ! bg.add(rect.x + 1, rect.y + 2); ! bg.add(rect.x + rect.w, rect.y + 2); bg.setColor(col); bg.add(rect.x + rect.w, rect.y + rect.h - 2); --- 273,278 ---- UVertexArray bg; bg.setColor(col.brighter()); ! bg.add(rect.x + 1, rect.y + 1); ! bg.add(rect.x + rect.w, rect.y + 1); bg.setColor(col); bg.add(rect.x + rect.w, rect.y + rect.h - 2); |
|
From: Johannes S. <sch...@us...> - 2005-10-25 12:18:36
|
Update of /cvsroot/libufo/ufo-0.5/msvc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1707/msvc Modified Files: ufo_all.dsp ufo_sdl.dsp ufo_wgl.dsp Log Message: Added tab widget, tab bar, stack widget. Index: ufo_all.dsp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/msvc/ufo_all.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ufo_all.dsp 2 Sep 2005 13:27:52 -0000 1.3 --- ufo_all.dsp 25 Oct 2005 12:18:21 -0000 1.4 *************** *** 405,408 **** --- 405,412 ---- # Begin Source File + SOURCE=..\src\widgets\ustackwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\util\ustring.cpp # End Source File *************** *** 421,424 **** --- 425,436 ---- # Begin Source File + SOURCE=..\src\widgets\utabbar.cpp + # End Source File + # Begin Source File + + SOURCE=..\src\widgets\utabwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\widgets\utextedit.cpp # End Source File Index: ufo_wgl.dsp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/msvc/ufo_wgl.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ufo_wgl.dsp 2 Sep 2005 13:27:52 -0000 1.3 --- ufo_wgl.dsp 25 Oct 2005 12:18:21 -0000 1.4 *************** *** 405,408 **** --- 405,412 ---- # Begin Source File + SOURCE=..\src\widgets\ustackwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\util\ustring.cpp # End Source File *************** *** 421,424 **** --- 425,436 ---- # Begin Source File + SOURCE=..\src\widgets\utabbar.cpp + # End Source File + # Begin Source File + + SOURCE=..\src\widgets\utabwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\widgets\utextedit.cpp # End Source File Index: ufo_sdl.dsp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/msvc/ufo_sdl.dsp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ufo_sdl.dsp 2 Sep 2005 13:27:52 -0000 1.5 --- ufo_sdl.dsp 25 Oct 2005 12:18:21 -0000 1.6 *************** *** 405,408 **** --- 405,412 ---- # Begin Source File + SOURCE=..\src\widgets\ustackwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\util\ustring.cpp # End Source File *************** *** 421,424 **** --- 425,436 ---- # Begin Source File + SOURCE=..\src\widgets\utabbar.cpp + # End Source File + # Begin Source File + + SOURCE=..\src\widgets\utabwidget.cpp + # End Source File + # Begin Source File + SOURCE=..\src\widgets\utextedit.cpp # End Source File |
|
From: Johannes S. <sch...@us...> - 2005-10-25 12:14:30
|
Update of /cvsroot/libufo/ufo-0.5/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv323/src Modified Files: uabstracttoolkit.cpp Log Message: Moved SDL video driver to be chosen last. Index: uabstracttoolkit.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/uabstracttoolkit.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** uabstracttoolkit.cpp 18 Oct 2005 16:39:24 -0000 1.23 --- uabstracttoolkit.cpp 25 Oct 2005 12:14:22 -0000 1.24 *************** *** 480,493 **** loadPlugin(theme); */ - // backend plugin - #ifdef UFO_USE_SDL - UPluginInfo sdlDriver; - sdlDriver.lib = NULL; - sdlDriver.category = "video_driver"; - sdlDriver.feature = "SDL"; - sdlDriver.create = &UXSDLDriver::createPlugin; - sdlDriver.destroy = &UXSDLDriver::destroyPlugin; - loadPlugin(sdlDriver); - #endif #ifdef UFO_USE_GLX UPluginInfo glxDriver; --- 480,483 ---- *************** *** 508,511 **** --- 498,511 ---- loadPlugin(wglDriver); #endif + // backend plugin + #ifdef UFO_USE_SDL + UPluginInfo sdlDriver; + sdlDriver.lib = NULL; + sdlDriver.category = "video_driver"; + sdlDriver.feature = "SDL"; + sdlDriver.create = &UXSDLDriver::createPlugin; + sdlDriver.destroy = &UXSDLDriver::destroyPlugin; + loadPlugin(sdlDriver); + #endif } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 16:04:05
|
Update of /cvsroot/libufo/ufo-0.5/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv732/test Modified Files: gui.xul Log Message: Added groupbox and tabbox element. Index: gui.xul =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/test/gui.xul,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gui.xul 11 Oct 2005 20:23:14 -0000 1.4 --- gui.xul 24 Oct 2005 16:03:54 -0000 1.5 *************** *** 46,51 **** <hbox align="center"> <radiogroup> ! <radio id="radio-red" label="Red" style="opacity: 0"/> ! <radio id="radio-green" label="Green" style="opacity: 0"/> </radiogroup> </hbox> --- 46,51 ---- <hbox align="center"> <radiogroup> ! <radio id="radio-red" class="transparent" label="Red"/> ! <radio id="radio-green" class="transparent" label="Green"/> </radiogroup> </hbox> *************** *** 58,62 **** <spacer/> ! <hbox align="center"> <!-- well, a list box --> <listbox id="listbox" rows="4"> --- 58,63 ---- <spacer/> ! <groupbox align="center"> ! <caption label="group box"/> <!-- well, a list box --> <listbox id="listbox" rows="4"> *************** *** 83,90 **** <progressmeter id="progress" value="50%"/> ! </hbox> <!-- spacer which increases twice as fast as a normal spacer --> <spacer flex="2"/> <hbox> --- 84,105 ---- <progressmeter id="progress" value="50%"/> ! </groupbox> <!-- spacer which increases twice as fast as a normal spacer --> <spacer flex="2"/> + <tabbox> + <tabs> + <tab label="Mail"/> + <tab label="News"/> + </tabs> + <tabpanels> + <tabpanel id="mailtab"> + <checkbox label="Automatically check for mail"/> + </tabpanel> + <tabpanel id="newstab"> + <button label="Clear News Buffer"/> + </tabpanel> + </tabpanels> + </tabbox> <hbox> |
|
From: Johannes S. <sch...@us...> - 2005-10-24 16:02:21
|
Update of /cvsroot/libufo/ufo-0.5/src/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32747/src/ui Modified Files: ubasicstyle.cpp Log Message: Implemented CE_TabBarTab and PE_Gripper. Polished some background elements with gradients. Index: ubasicstyle.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/ui/ubasicstyle.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ubasicstyle.cpp 11 Oct 2005 20:22:56 -0000 1.8 --- ubasicstyle.cpp 24 Oct 2005 16:02:13 -0000 1.9 *************** *** 167,170 **** --- 167,184 ---- break; + case PE_Gripper: { + UColor dark = hints->palette.background().darker(); + UColor light = hints->palette.background().brighter(); + // FIXME: wow, very inefficient + for (int x = 2; x <= rect.w - 2; x += 4) { + for (int y = 2; y <= rect.h - 2; y += 4) { + g->setColor(dark); + g->fillRect(rect.x + x, rect.y + y, 2, 2); + g->setColor(light); + g->fillRect(rect.x + x + 1, rect.y + y + 1, 1, 1); + } + } + } + break; case PE_IndicatorCheckBox: if (widgetState & WidgetDisabled) { *************** *** 201,208 **** } if (widgetState & WidgetSelected) { ! g->setLineWidth(2); ! g->drawLine(rect.x + 2, rect.y + 2, rect.x + rect.w - 3, rect.y + rect.h - 3); ! g->drawLine(rect.x + rect.w - 4, rect.y + 3, rect.x + 1, rect.y + rect.h - 2); ! g->setLineWidth(1); } break; --- 215,224 ---- } if (widgetState & WidgetSelected) { ! //g->setLineWidth(2); ! g->drawLine(rect.x + 2, rect.y + 2, rect.x + rect.w - 2, rect.y + rect.h - 2); ! g->drawLine(rect.x + 3, rect.y + 2, rect.x + rect.w - 1, rect.y + rect.h - 2); ! g->drawLine(rect.x + 2, rect.y + rect.h - 3, rect.x + rect.w - 2, rect.y + 1); ! g->drawLine(rect.x + 3, rect.y + rect.h - 3, rect.x + rect.w - 1, rect.y + 1); ! //g->setLineWidth(1); } break; *************** *** 247,259 **** if (hints->opacity) { UColor col(hints->palette.background()); ! if (widgetState & (WidgetPressed)) { col = col.darker(); } col.getFloat()[3] = hints->opacity; ! g->setColor(col); // don't paint edges (frame) g->drawLine(rect.x + 2, rect.y + 1, rect.x + rect.w - 2, rect.y + 1); ! g->fillRect(rect.x + 1, rect.y + 2, rect.w - 2, rect.h - 4); ! g->drawLine(rect.x + 2, rect.y + rect.h - 2, rect.x + rect.w - 2, rect.y + rect.h - 2); } if (widgetState & (WidgetSelected | WidgetHasMouseFocus)) { --- 263,286 ---- if (hints->opacity) { UColor col(hints->palette.background()); ! if (widgetState & (WidgetPressed | WidgetSelected)) { col = col.darker(); } col.getFloat()[3] = hints->opacity; ! g->setColor(col.brighter()); // don't paint edges (frame) g->drawLine(rect.x + 2, rect.y + 1, rect.x + rect.w - 2, rect.y + 1); ! ! UVertexArray bg; ! bg.setColor(col.brighter()); ! bg.add(rect.x + 1, rect.y + 2); ! bg.add(rect.x + rect.w, rect.y + 2); ! bg.setColor(col); ! bg.add(rect.x + rect.w, rect.y + rect.h - 2); ! bg.add(rect.x + 1, rect.y + rect.h - 2); ! g->drawVertexArray(UGraphics::TriangleFan, &bg); ! ! g->setColor(col); ! //g->fillRect(rect.x + 1, rect.y + 2, rect.w - 2, rect.h - 4); ! g->drawLine(rect.x + 2, rect.y + rect.h - 1, rect.x + rect.w - 2, rect.y + rect.h - 1); } if (widgetState & (WidgetSelected | WidgetHasMouseFocus)) { *************** *** 633,639 **** case CE_Slider: if (hints->orientation == Vertical) { ! return ret + UInsets(0, 0, 0, 12); } else { ! return ret + UInsets(12, 0, 0, 0); } break; --- 660,666 ---- case CE_Slider: if (hints->orientation == Vertical) { ! return ret + UInsets(0, 0, 0, 14); } else { ! return ret + UInsets(14, 0, 0, 0); } break; *************** *** 663,666 **** --- 690,697 ---- return ret + UInsets(2, 3, 3, 3); break; + case CE_TabBarTab: + // plus border + return ret + UInsets(3, 3, 2, 3); + break; default: return ret; *************** *** 709,713 **** break; case CE_CheckBox: { ! paintPrimitive(g, PE_PanelButtonBevel, rect, hints, model->widgetState); //const UCompoundModel * compound = static_cast<const UCompoundModel*>(model); URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); --- 740,745 ---- break; case CE_CheckBox: { ! //paintPrimitive(g, PE_PanelButtonBevel, rect, hints, model->widgetState); ! paintPrimitive(g, PE_PanelWidget, rect, hints, model->widgetState); //const UCompoundModel * compound = static_cast<const UCompoundModel*>(model); URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); *************** *** 721,726 **** break; case CE_RadioButton: { ! paintPrimitive(g, PE_PanelButtonBevel, rect, hints, model->widgetState); //const UCompoundModel * compound = static_cast<const UCompoundModel*>(model); URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); //if (compound->icon == NULL) { --- 753,759 ---- break; case CE_RadioButton: { ! //paintPrimitive(g, PE_PanelButtonBevel, rect, hints, model->widgetState); //const UCompoundModel * compound = static_cast<const UCompoundModel*>(model); + paintPrimitive(g, PE_PanelWidget, rect, hints, model->widgetState); URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); //if (compound->icon == NULL) { *************** *** 737,742 **** if (menuItem->widgetState & WidgetHasMouseFocus || menuItem->widgetState & WidgetHighlighted) { ! g->setColor(hints->palette.highlight()); ! g->fillRect(rect); } URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); --- 770,785 ---- if (menuItem->widgetState & WidgetHasMouseFocus || menuItem->widgetState & WidgetHighlighted) { ! ! UVertexArray bg; ! bg.setColor(hints->palette.highlight().brighter()); ! bg.add(rect.x, rect.y); ! bg.add(rect.x + rect.w, rect.y); ! bg.setColor(hints->palette.highlight()); ! bg.add(rect.x + rect.w, rect.y + rect.h); ! bg.add(rect.x, rect.y + rect.h); ! g->drawVertexArray(UGraphics::TriangleFan, &bg); ! ! //g->setColor(hints->palette.highlight()); ! //g->fillRect(rect); } URectangle icon_rect(0, rect.h / 2 - 6, 12, 12); *************** *** 922,925 **** --- 965,969 ---- } g->fillRect(slider_rect); + paintPrimitive(g, PE_Gripper, slider_rect - UInsets(2, 0, 2, 0), hints, model->widgetState); g->setColor(hints->palette.highlight().darker()); g->drawRect(slider_rect); *************** *** 948,953 **** (pModel->maximum - pModel->minimum) ); ! g->setColor(hints->palette.highlight()); ! g->fillRect(rect.x, rect.y, width, rect.h); paintBorder(g, LineBorder, rect, hints, model->widgetState); if (pModel->textVisible) { --- 992,1006 ---- (pModel->maximum - pModel->minimum) ); ! //g->setColor(hints->palette.highlight()); ! //g->fillRect(rect.x, rect.y, width, rect.h); ! UVertexArray bg; ! bg.setColor(hints->palette.highlight().darker()); ! bg.add(rect.x, rect.y); ! bg.add(rect.x + width, rect.y); ! bg.setColor(hints->palette.highlight().brighter()); ! bg.add(rect.x + width, rect.y + rect.h); ! bg.add(rect.x, rect.y + rect.h); ! g->drawVertexArray(UGraphics::TriangleFan, &bg); ! paintBorder(g, LineBorder, rect, hints, model->widgetState); if (pModel->textVisible) { *************** *** 999,1026 **** g->drawRect(slider_rect); */ ! //g->setEnabled(UGraphics::LineAntialiasing, true); ! float arr_height = slider_rect.h * 0.7; ! float arr_height_2 = slider_rect.h * 0.9; ! g->setColor(hints->palette.background().darker()); ! UVertexArray array; ! array.add(slider_rect.x + 1, slider_rect.y); ! array.add(slider_rect.x - 1 + slider_rect.w, slider_rect.y); ! array.add(slider_rect.x + slider_rect.w, slider_rect.y + 1); ! array.add(slider_rect.x + slider_rect.w, slider_rect.y + arr_height); ! ! array.add(slider_rect.x + slider_rect.w * 0.75f, slider_rect.y + arr_height_2); ! array.add(slider_rect.x + slider_rect.w / 2, slider_rect.y + slider_rect.h); ! array.add(slider_rect.x + slider_rect.w * 0.25f, slider_rect.y + arr_height_2); ! ! array.add(slider_rect.x, slider_rect.y + arr_height); ! array.add(slider_rect.x, slider_rect.y + 1); ! array.add(slider_rect.x + 1, slider_rect.y); ! g->setColor(hints->palette.background()); ! g->drawVertexArray(UGraphics::TriangleFan, &array); ! g->setColor(hints->palette.dark()); ! g->drawVertexArray(UGraphics::LineStrip, &array); ! g->drawRect(slider_rect.x + 2, slider_rect.y + 3, 2, 2); ! g->drawRect(slider_rect.x + slider_rect.w - 3, slider_rect.y + 3, 2, 2); } } --- 1052,1059 ---- g->drawRect(slider_rect); */ ! paintPrimitive(g, PE_PanelButtonBevel, slider_rect, hints, model->widgetState); ! paintPrimitive(g, PE_FrameButtonBevel, slider_rect, hints, model->widgetState); ! paintPrimitive(g, PE_Gripper, slider_rect - UInsets(2, 1, 2, 1), hints, model->widgetState); } } *************** *** 1170,1174 **** case CE_Splitter: break; ! case CE_TabBarTab: break; case CE_GroupBox: { --- 1203,1248 ---- case CE_Splitter: break; ! case CE_TabBarTab: { ! //paintPrimitive(g, PE_PanelButtonBevel, rect, hints, model->widgetState); ! ! if (hints->opacity) { ! UColor col(hints->palette.background()); ! if (model->widgetState & (WidgetPressed | WidgetSelected)) { ! col = col.darker(); ! } ! col.getFloat()[3] = hints->opacity; ! g->setColor(col.brighter()); ! // don't paint edges (frame) ! g->drawLine(rect.x + 2, rect.y + 1, rect.x + rect.w - 2, rect.y + 1); ! ! UVertexArray bg; ! bg.setColor(col.brighter()); ! bg.add(rect.x + 1, rect.y + 2); ! bg.add(rect.x + rect.w, rect.y + 2); ! bg.setColor(col); ! bg.add(rect.x + rect.w, rect.y + rect.h); ! bg.add(rect.x + 1, rect.y + rect.h); ! g->drawVertexArray(UGraphics::TriangleFan, &bg); ! } ! ! paintComponent(g, CE_Compound, rect - insets, hints, model); ! ! g->setColor(hints->palette.background().darker()); ! UVertexArray array; ! if (model->widgetState & WidgetSelected) { ! array.add(rect.x, rect.y + rect.h); ! array.add(rect.x, rect.y + 2); ! array.add(rect.x + 2, rect.y); ! array.add(rect.x + rect.w - 3, rect.y); ! array.add(rect.x + rect.w - 1, rect.y + 2); ! array.add(rect.x + rect.w - 1, rect.y + rect.h); ! } else { ! array.add(rect.x, rect.y + rect.h); ! array.add(rect.x, rect.y + 2); ! array.add(rect.x + rect.w - 1, rect.y + 2); ! array.add(rect.x + rect.w - 1, rect.y + rect.h); ! } ! g->drawVertexArray(UGraphics::LineStrip, &array); ! } break; case CE_GroupBox: { *************** *** 1347,1351 **** const USliderModel * sliderModel = static_cast<const USliderModel*>(model); int width = 8; ! int height = 12; int maxlen = (hints->orientation == Vertical) ? rect.h : rect.w; int pos = basicstyle_sliderModelToView( --- 1421,1425 ---- const USliderModel * sliderModel = static_cast<const USliderModel*>(model); int width = 8; ! int height = 14; int maxlen = (hints->orientation == Vertical) ? rect.h : rect.w; int pos = basicstyle_sliderModelToView( |
|
From: Johannes S. <sch...@us...> - 2005-10-24 16:01:08
|
Update of /cvsroot/libufo/ufo-0.5/src/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32296/src/xml Modified Files: uxul.cpp Log Message: Implemented group box, deck, stack and tabbox. Index: uxul.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/xml/uxul.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** uxul.cpp 30 Sep 2005 12:37:44 -0000 1.8 --- uxul.cpp 24 Oct 2005 16:00:55 -0000 1.9 *************** *** 37,40 **** --- 37,42 ---- #include "ufo/widgets/ucombobox.hpp" #include "ufo/widgets/ucheckbox.hpp" + #include "ufo/widgets/ugroupbox.hpp" + #include "ufo/widgets/ustackwidget.hpp" #include "ufo/widgets/uradiobutton.hpp" #include "ufo/widgets/ulabel.hpp" *************** *** 45,48 **** --- 47,51 ---- #include "ufo/widgets/ucheckboxmenuitem.hpp" #include "ufo/widgets/umenubar.hpp" + #include "ufo/widgets/utabwidget.hpp" #include "ufo/widgets/utextedit.hpp" #include "ufo/widgets/ulineedit.hpp" *************** *** 374,377 **** --- 377,418 ---- } + void + createChildren(TiXmlElement * elem, UWidget * container); + + UTabWidget * + createTabBox(TiXmlElement * elem) { + std::vector<std::string> m_tabs; + std::vector<UWidget*> m_panels; + + if (TiXmlElement * tabs = elem->FirstChildElement("tabs")) { + TiXmlElement* tabElement = tabs->FirstChildElement(); + for(; tabElement; tabElement = tabElement->NextSiblingElement()) { + std::string value = UString(tabElement->Value()).lowerCase(); + if ("tab" == value && tabElement->Attribute("label")) { + m_tabs.push_back(tabElement->Attribute("label")); + } + } + } + if (TiXmlElement * panels = elem->FirstChildElement("tabpanels")) { + TiXmlElement* panelElement = panels->FirstChildElement(); + for(; panelElement; panelElement = panelElement->NextSiblingElement()) { + std::string value = UString(panelElement->Value()).lowerCase(); + if ("tabpanel" == value) { + UWidget * tabPanel = new UWidget(); + genericWidget(panelElement, tabPanel); + createLayout(panelElement, tabPanel); + createChildren(panelElement, tabPanel); + m_panels.push_back(tabPanel); + } + } + } + UTabWidget * tabBox = new UTabWidget(); + unsigned int min_size = std::min(m_tabs.size(), m_panels.size()); + for (unsigned int i = 0; i < min_size; ++i) { + tabBox->addTab(m_panels[i], m_tabs[i]); + } + return tabBox; + } + void *************** *** 395,398 **** --- 436,462 ---- // recursively create children createChildren(widgetElement, widget); + } else if ("groupbox" == value) { + UGroupBox * box = new UGroupBox(); + genericWidget(widgetElement, box); + if (TiXmlElement * caption = widgetElement->FirstChildElement("caption")) { + if (caption->Attribute("label")) { + box->setTitle(caption->Attribute("label")); + } + } + container->add(box); + // recursively create children + createChildren(widgetElement, box); + } else if ("deck" == value) { + UStackWidget * deck = new UStackWidget(1); + genericWidget(widgetElement, deck); + container->add(deck); + // recursively create children + createChildren(widgetElement, deck); + } else if ("stack" == value) { + UStackWidget * stack = new UStackWidget(0); + genericWidget(widgetElement, stack); + container->add(stack); + // recursively create children + createChildren(widgetElement, stack); } else if ("button" == value) { UButton * button = new UButton(); *************** *** 503,506 **** --- 567,574 ---- } else if ("radiogroup" == value) { createRadioGroup(widgetElement, container); + } else if ("tabbox" == value) { + UTabWidget * tabBox = createTabBox(widgetElement); + genericWidget(widgetElement, tabBox); + container->add(tabBox); } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 16:00:38
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32035/include/ufo/ui Modified Files: ustyle.hpp Log Message: Added gripper element. Index: ustyle.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/ui/ustyle.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ustyle.hpp 21 Jun 2005 09:27:15 -0000 1.6 --- ustyle.hpp 24 Oct 2005 16:00:26 -0000 1.7 *************** *** 89,93 **** PE_FrameStatusBar, PE_FrameLineEdit, ! PE_FrameFocusRect }; enum ComponentElement { --- 89,94 ---- PE_FrameStatusBar, PE_FrameLineEdit, ! PE_FrameFocusRect, ! PE_Gripper }; enum ComponentElement { *************** *** 168,172 **** uint32_t widgetState) = 0; ! /** Paints a component of a widget resp. the whole widget. */ virtual void paintComponent(UGraphics * g, ComponentElement elem, --- 169,176 ---- uint32_t widgetState) = 0; ! /** Paints a component of a widget resp. the whole widget. ! * For most components, this is only a call to paintModelBackground and ! * paintModel. ! */ virtual void paintComponent(UGraphics * g, ComponentElement elem, *************** *** 252,259 **** URectangle * iconRect) = 0; ! /** May be used to install style properties. */ virtual void install(UWidget * w) = 0; - /** Uninstalls formerly installed properties. */ virtual void uninstall(UWidget * w) = 0; }; --- 256,315 ---- URectangle * iconRect) = 0; ! /** Stub method. Configures a widget to be used with this style. ! * Not yet implementd. ! */ virtual void install(UWidget * w) = 0; virtual void uninstall(UWidget * w) = 0; + #if 0 + // API ideas + /** @return The preferred contents size for the given model. + */ + virtual UDimension getPreferredSizeFromModel( + ComponentElement elem, + const UDimension & maxSize, + const UStyleHints * hints, + const UWidgetModel * model, + UWidget * w = NULL) = 0; + + /** Paints the background for the given component element, + * eventually using the given model. + */ + virtual void paintModelBackground( + ComponentElement elem, + const URectangle & rect, + const UStyleHints * hints, + const UWidgetModel * model, + UWidget * w = NULL) = 0; + + /** Paints the contents of the given model. + * This may be a label and icon of buttons, text of text widgets etc. + */ + virtual void paintModel( + ComponentElement elem, + const URectangle & rect, + const UStyleHints * hints, + const UWidgetModel * model, + UWidget * w = NULL) = 0; + + /** Returns a two dimensional model index currently represented as UPoint. + * + */ + virtual UPoint viewToModel( + ComponentElement elem, + const URectangle & rect, + const UStyleHints * hints, + const UWidgetModel * model, + const UPoint & pos, + UWidget * w = NULL) = 0; + + /** @return The bounding rectangle of a model index.*/ + virtual URectangle modelToView( + ComponentElement elem, + const URectangle & rect, + const UStyleHints * hints, + const UWidgetModel * model, + const UPoint & pos, + UWidget * w = NULL) = 0; + #endif }; |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:59:47
|
Update of /cvsroot/libufo/ufo-0.5/src/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31686/src/gl Modified Files: ugl_image.cpp Log Message: Updated to new volatile data API. Index: ugl_image.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/gl/ugl_image.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ugl_image.cpp 21 May 2005 15:18:46 -0000 1.5 --- ugl_image.cpp 24 Oct 2005 15:59:40 -0000 1.6 *************** *** 317,324 **** if (!m_autoRefresh) { dispose(); ! } if (m_isValid) { getDisplay()->addVolatileData(this); ! } } --- 317,324 ---- if (!m_autoRefresh) { dispose(); ! }/* if (m_isValid) { getDisplay()->addVolatileData(this); ! }*/ } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:58:53
|
Update of /cvsroot/libufo/ufo-0.5/src/font In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31485/src/font Modified Files: ufont.cpp Log Message: Updated to new volatile data API. Index: ufont.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/font/ufont.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ufont.cpp 12 Jul 2005 13:29:06 -0000 1.12 --- ufont.cpp 24 Oct 2005 15:58:43 -0000 1.13 *************** *** 242,248 **** m_renderer = tk->createFontRenderer(info); fontContextCache[m_renderer->getFontInfo()] = m_renderer; - display->addVolatileData(m_renderer); - //static int nfonts = 0; - //std::cerr << "created " << ++nfonts << " fonts\n"; } --- 242,245 ---- *************** *** 254,264 **** UFont::dispose() { // ref count == 1: we have to remove it from the cache ! if (UDisplay::getDefault() && m_renderer && m_renderer->getReferenceCount() == 1) { ! UDisplay * display = UDisplay::getDefault(); // FIXME: see above //fontCache_t fontContextCache = sm_fontCache[display]; if (fontContextCache[m_renderer->getFontInfo()]) { fontContextCache.erase(m_renderer->getFontInfo()); - display->removeVolatileData(m_renderer); } } --- 251,259 ---- UFont::dispose() { // ref count == 1: we have to remove it from the cache ! if (m_renderer && m_renderer->getReferenceCount() == 1) { // FIXME: see above //fontCache_t fontContextCache = sm_fontCache[display]; if (fontContextCache[m_renderer->getFontInfo()]) { fontContextCache.erase(m_renderer->getFontInfo()); } } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:58:15
|
Update of /cvsroot/libufo/ufo-0.5/src/ux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31428/src/ux Modified Files: uxdisplay.cpp Log Message: Fixed clean-up of ugl_driver in dummy video driver. Index: uxdisplay.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/ux/uxdisplay.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** uxdisplay.cpp 15 Sep 2005 10:18:28 -0000 1.9 --- uxdisplay.cpp 24 Oct 2005 15:58:08 -0000 1.10 *************** *** 64,67 **** --- 64,68 ---- if (m_createdGLDriver) { delete (ugl_driver); + ugl_driver = NULL; } m_isInit = false; |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:57:39
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31290/include/ufo Modified Files: umodel.hpp Log Message: Added button model. Index: umodel.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/umodel.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** umodel.hpp 21 Jun 2005 09:26:40 -0000 1.2 --- umodel.hpp 24 Oct 2005 15:57:31 -0000 1.3 *************** *** 40,43 **** --- 40,44 ---- class UDocument; class UTextLayout; + /** @short A widget model represents the application data of a widget * which is painted by UStyle and modified by UWidget. *************** *** 83,86 **** --- 84,100 ---- class UCompoundModel : public UWidgetModel { public: + std::string text; + UIcon * icon; + int acceleratorIndex; + }; + + /** @short The button model represents the application data of a generic + * button (including check boxes and radio buttons). + * @ingroup internal + * + * @author Johannes Schmidt + */ + class UButtonModel : public UCompoundModel { + public: enum ButtonFeatures { None = 0, *************** *** 89,96 **** HasMenu = 4 }; ! std::string text; ! UIcon * icon; ! int acceleratorIndex; ! uint32_t buttonFeatures; }; --- 103,114 ---- HasMenu = 4 }; ! enum CheckType { ! NotCheckable = 0, ! Exclusive, ! NonExclusive ! }; ! int buttonFeatures; ! int checkType; ! UKeyStroke shortcut; }; *************** *** 101,110 **** * @author Johannes Schmidt */ ! class UMenuItemModel : public UCompoundModel { public: - enum CheckType { NotCheckable = 0, Exclusive, NonExclusive }; - int checkType; int maxIconWidth; - UKeyStroke shortcut; }; --- 119,125 ---- * @author Johannes Schmidt */ ! class UMenuItemModel : public UButtonModel { public: int maxIconWidth; }; |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:57:39
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31290/src/widgets Modified Files: ucompound.cpp umenuitem.cpp Log Message: Added button model. Index: umenuitem.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/umenuitem.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** umenuitem.cpp 30 Sep 2005 12:37:20 -0000 1.13 --- umenuitem.cpp 24 Oct 2005 15:57:31 -0000 1.14 *************** *** 54,58 **** c->text = model->text; c->acceleratorIndex = model->acceleratorIndex; ! c->buttonFeatures = model->buttonFeatures; c->checkType = checkType; c->maxIconWidth = maxIconWidth; --- 54,58 ---- c->text = model->text; c->acceleratorIndex = model->acceleratorIndex; ! c->buttonFeatures = UMenuItemModel::None;;//model->buttonFeatures; c->checkType = checkType; c->maxIconWidth = maxIconWidth; Index: ucompound.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/ucompound.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ucompound.cpp 2 Sep 2005 13:24:56 -0000 1.11 --- ucompound.cpp 24 Oct 2005 15:57:31 -0000 1.12 *************** *** 43,47 **** c->text = text; c->acceleratorIndex = -1; ! c->buttonFeatures = UCompoundModel::None; delete (model); return c; --- 43,47 ---- c->text = text; c->acceleratorIndex = -1; ! //c->buttonFeatures = UCompoundModel::None; delete (model); return c; *************** *** 164,169 **** void UCompound::processStateChangeEvent(uint32_t state) { - (static_cast<UCompoundModel*>(m_model))->icon = getIcon(); UWidget::processStateChangeEvent(state); if (state & WidgetVisible) { updateMnemonic(); --- 164,171 ---- void UCompound::processStateChangeEvent(uint32_t state) { UWidget::processStateChangeEvent(state); + if (isVisible() || state & WidgetVisible) { + (static_cast<UCompoundModel*>(m_model))->icon = getIcon(); + } if (state & WidgetVisible) { updateMnemonic(); |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:56:17
|
Update of /cvsroot/libufo/ufo-0.5/src/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30940/src/gl Modified Files: ugl_graphics.cpp Log Message: Adding support for smooth colored triangles. Index: ugl_graphics.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/gl/ugl_graphics.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ugl_graphics.cpp 11 Oct 2005 20:22:06 -0000 1.15 --- ugl_graphics.cpp 24 Oct 2005 15:56:06 -0000 1.16 *************** *** 440,449 **** // basic drawing operations // ! static float add_width = 0.5f; void UGL_Graphics::drawRect(const URectangle & rect) { // -1 is correct, as lines are drawn like rectangles with // width 1 measured in y direction ! ugl_driver->glTranslatef(add_width, add_width, 0); ugl_driver->glBegin(GL_LINE_LOOP); ugl_driver->glVertex2i(rect.x, rect.y); --- 440,449 ---- // basic drawing operations // ! static float ufo_line_add = 0.5f; void UGL_Graphics::drawRect(const URectangle & rect) { // -1 is correct, as lines are drawn like rectangles with // width 1 measured in y direction ! ugl_driver->glTranslatef(ufo_line_add, ufo_line_add, 0); ugl_driver->glBegin(GL_LINE_LOOP); ugl_driver->glVertex2i(rect.x, rect.y); *************** *** 452,456 **** ugl_driver->glVertex2i(rect.x + rect.w - 1, rect.y); ugl_driver->glEnd(); ! ugl_driver->glTranslatef(-add_width, -add_width, 0); } --- 452,456 ---- ugl_driver->glVertex2i(rect.x + rect.w - 1, rect.y); ugl_driver->glEnd(); ! ugl_driver->glTranslatef(-ufo_line_add, -ufo_line_add, 0); } *************** *** 462,483 **** void UGL_Graphics::drawLine(const UPoint & p1, const UPoint & p2) { ! ugl_driver->glTranslatef(add_width, add_width, 0); ugl_driver->glBegin(GL_LINES); ugl_driver->glVertex2i(p1.x, p1.y); ugl_driver->glVertex2i(p2.x, p2.y); ugl_driver->glEnd(); ! ugl_driver->glTranslatef(-add_width, -add_width, 0); } void UGL_Graphics::drawVertexArray(VertexType type, UVertexArray * buffer) { int glType; switch (type) { case Lines: glType = GL_LINES; - ugl_driver->glTranslatef(add_width, add_width, 0); break; case LineStrip: glType = GL_LINE_STRIP; ! ugl_driver->glTranslatef(add_width, add_width, 0); break; case Triangles: --- 462,483 ---- void UGL_Graphics::drawLine(const UPoint & p1, const UPoint & p2) { ! ugl_driver->glTranslatef(ufo_line_add, ufo_line_add, 0); ugl_driver->glBegin(GL_LINES); ugl_driver->glVertex2i(p1.x, p1.y); ugl_driver->glVertex2i(p2.x, p2.y); ugl_driver->glEnd(); ! ugl_driver->glTranslatef(-ufo_line_add, -ufo_line_add, 0); } void UGL_Graphics::drawVertexArray(VertexType type, UVertexArray * buffer) { int glType; + ugl_driver->glTranslatef(ufo_line_add, ufo_line_add, 0); switch (type) { case Lines: glType = GL_LINES; break; case LineStrip: glType = GL_LINE_STRIP; ! //ugl_driver->glTranslatef(ufo_line_add, ufo_line_add, 0); break; case Triangles: *************** *** 498,512 **** ugl_driver->glDrawArrays(glType, 0, buffer->getCount()); } else if (buffer->getType() == UVertexArray::C3F_V3F) { ugl_driver->glInterleavedArrays(GL_C3F_V3F, 0, buffer->getArray()); ugl_driver->glDrawArrays(glType, 0, buffer->getCount()); } switch (type) { case Lines: glType = GL_LINES; - ugl_driver->glTranslatef(-add_width, -add_width, 0); break; case LineStrip: glType = GL_LINE_STRIP; ! ugl_driver->glTranslatef(-add_width, -add_width, 0); break; } --- 498,514 ---- ugl_driver->glDrawArrays(glType, 0, buffer->getCount()); } else if (buffer->getType() == UVertexArray::C3F_V3F) { + ugl_driver->glShadeModel(GL_SMOOTH); ugl_driver->glInterleavedArrays(GL_C3F_V3F, 0, buffer->getArray()); ugl_driver->glDrawArrays(glType, 0, buffer->getCount()); + ugl_driver->glShadeModel(GL_FLAT); } + ugl_driver->glTranslatef(-ufo_line_add, -ufo_line_add, 0); switch (type) { case Lines: glType = GL_LINES; break; case LineStrip: glType = GL_LINE_STRIP; ! //ugl_driver->glTranslatef(-ufo_line_add, -ufo_line_add, 0); break; } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:55:24
|
Update of /cvsroot/libufo/ufo-0.5/src/layouts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30761/src/layouts Modified Files: uboxlayout.cpp Log Message: Fixed getPreferredSize for implicitely hidden widgets. Index: uboxlayout.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/layouts/uboxlayout.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** uboxlayout.cpp 30 Sep 2005 12:37:20 -0000 1.14 --- uboxlayout.cpp 24 Oct 2005 15:55:17 -0000 1.15 *************** *** 76,80 **** UWidget * w = container->getWidget(i); ! if (w->isVisible()) { // FIXME: Resize maxSize to respect already "consumed" space const UDimension & size = w->getPreferredSize(maxSize); --- 76,80 ---- UWidget * w = container->getWidget(i); ! if (w->isVisible() || !w->testState(WidgetForceInvisible)) { // FIXME: Resize maxSize to respect already "consumed" space const UDimension & size = w->getPreferredSize(maxSize); |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:54:40
|
Update of /cvsroot/libufo/ufo-0.5/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30607/src Modified Files: uvertexarray.cpp Log Message: Fixed color array when adding new vectors. Index: uvertexarray.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/uvertexarray.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** uvertexarray.cpp 30 Sep 2005 12:37:20 -0000 1.4 --- uvertexarray.cpp 24 Oct 2005 15:54:32 -0000 1.5 *************** *** 53,57 **** UVertexArray::add(float x, float y) { m_vertices.push_back(std::make_pair(x, y)); ! if (m_colors.size()) { m_colors.push_back(m_colors[m_colors.size() - 1]); } --- 53,57 ---- UVertexArray::add(float x, float y) { m_vertices.push_back(std::make_pair(x, y)); ! if (m_colors.size() && m_vertices.size() > m_colors.size()) { m_colors.push_back(m_colors[m_colors.size() - 1]); } *************** *** 103,107 **** return m_array; } ! // create a new array if (m_type == V3F) { --- 103,107 ---- return m_array; } ! // create a new array if (m_type == V3F) { |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:52:23
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30102/include/ufo/widgets Added Files: ustackwidget.hpp utabbar.hpp utabwidget.hpp Log Message: Added tab widget, tab bar and stack widget. --- NEW FILE: utabbar.hpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : include/ufo/widgets/utabbar.hpp begin : Fri Sep 23 2005 $Id: utabbar.hpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #ifndef UTABBAR_HPP #define UTABBAR_HPP #include "uwidget.hpp" namespace ufo { /** @short A tab bar provides a box of tabs which may be used to select * tab panels of a tab widgets. * @ingroup widgets * * * @author Johannes Schmidt */ class UFO_EXPORT UTabBar : public UWidget { UFO_DECLARE_CLASS(UTabBar) public: UTabBar(); virtual ~UTabBar(); public: // Public methods void addTab(const std::string & label); /** Removes the tab at the given index and eventually resets * the selected index. */ void removeTab(int index); void setSelectedIndex(int index); int getSelectedIndex() const; /** Returns the label of the tab bar tab with the given index * or "" if the index is out of range. */ std::string getTabText(int index) const; /** Returns the index of the tab bar tab with the given label * or -1 if no tab has this label. */ int getTabIndex(const std::string & label) const; int getTabCount() const; private: int m_selectedIndex; public: // Public signals USignal1<UTabBar*> & sigSelectionChanged(); private: // Private signals USignal1<UTabBar*> m_sigSelectionChanged; }; // // inline implementation // inline USignal1<UTabBar*> & UTabBar::sigSelectionChanged() { return m_sigSelectionChanged; } } // namespace ufo #endif // UTABBAR_HPP --- NEW FILE: utabwidget.hpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : include/ufo/widgets/utabwidget.hpp begin : Fri Sep 23 2005 $Id: utabwidget.hpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #ifndef UTABWIDGET_HPP #define UTABWIDGET_HPP #include "uwidget.hpp" namespace ufo { class UStackWidget; class UTabBar; /** @short A tab widget provides a stack of widgets which order * may be changed via tabs. * @ingroup widgets * * * @author Johannes Schmidt */ class UFO_EXPORT UTabWidget : public UWidget { UFO_DECLARE_CLASS(UTabWidget) public: UTabWidget(); virtual ~UTabWidget(); public: // Public methods void addTab(UWidget * child, const std::string & label); void removeTab(int index); /** Returns the label of the tab bar tab with the given index * or "" if the index is out of range. */ std::string getTabText(int index) const; /** Returns the tab page with the given index * or NULL if the index is out of range. */ UWidget * getTabWidget(int index) const; /** Returns the index of the tab bar tab with the given label * or -1 if no tab has this label. */ int getTabIndex(const std::string & label) const; /** Returns the tab index for the given child (or -1). */ int getTabIndex(UWidget * child) const; void setSelectedIndex(int index); int getSelectedIndex() const; int getTabCount() const; protected: // Protected methods virtual void slotTabSelected(UTabBar * bar); public: // Public signals USignal1<UTabWidget*> & sigSelectionChanged(); private: // Private signals USignal1<UTabWidget*> m_sigSelectionChanged; private: UStackWidget * m_stackWidget; UTabBar * m_tabBar; }; // // inline implementation // inline USignal1<UTabWidget*> & UTabWidget::sigSelectionChanged() { return m_sigSelectionChanged; } } // namespace ufo #endif // UTABWIDGET_HPP --- NEW FILE: ustackwidget.hpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : include/ufo/widgets/ustackwidget.hpp begin : Fri Sep 23 2005 $Id: ustackwidget.hpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #ifndef USTACKWIDGET_HPP #define USTACKWIDGET_HPP #include "uwidget.hpp" namespace ufo { /** @short A stack widget orders its child widgets as stack. * @ingroup widgets * * There are two types of stacks. If exclusive mode is selected, only * the current selected widget is shown. Otherwise you get the whole stack * shown. * * @author Johannes Schmidt */ class UFO_EXPORT UStackWidget : public UWidget { UFO_DECLARE_CLASS(UStackWidget) public: /** Creates a stack widget which exclusively shows the selected widget. */ UStackWidget(); /** Creates a stack widget with the given selection mode. * FIXME: what is a selection mode, define selection model etc. */ UStackWidget(int selectionMode); public: // Public methods void setSelectedIndex(int index); int getSelectedIndex() const; protected: // Overrides UWidget virtual void addImpl(UWidget * w, UObject * constraints, int index); virtual bool removeImpl(int index); virtual UDimension getContentsSize(const UDimension & maxSize) const; private: int m_selectedIndex; int m_selectionMode; }; } // namespace ufo #endif // USTACKEDWIDGET_HPP |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:52:19
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30102/include/ufo Modified Files: ufo.hpp Log Message: Added tab widget, tab bar and stack widget. Index: ufo.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/ufo.hpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ufo.hpp 21 Jun 2005 09:26:40 -0000 1.23 --- ufo.hpp 24 Oct 2005 15:52:02 -0000 1.24 *************** *** 146,149 **** --- 146,152 ---- #include "widgets/uslider.hpp" #include "widgets/uspinbox.hpp" + #include "widgets/ustackwidget.hpp" + #include "widgets/utabbar.hpp" + #include "widgets/utabwidget.hpp" #include "widgets/utextedit.hpp" #include "widgets/utextwidget.hpp" |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:52:14
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30102/src/widgets Modified Files: Makefile.am Added Files: ustackwidget.cpp utabbar.cpp utabwidget.cpp Log Message: Added tab widget, tab bar and stack widget. --- NEW FILE: utabwidget.cpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : src/widgets/utabwidget.hpp begin : Sun Sep 25 2005 $Id: utabwidget.cpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #include "ufo/widgets/utabwidget.hpp" #include "ufo/widgets/ustackwidget.hpp" #include "ufo/widgets/utabbar.hpp" #include "ufo/layouts/uborderlayout.hpp" using namespace ufo; UFO_IMPLEMENT_CLASS(UTabWidget, UWidget) UTabWidget::UTabWidget() : m_stackWidget(new UStackWidget()) , m_tabBar(new UTabBar()) { setLayout(new UBorderLayout(0, 0)); add(m_stackWidget); add(m_tabBar, UBorderLayout::North); m_stackWidget->setBorder(LineBorder); m_tabBar->sigSelectionChanged().connect(slot(*this, &UTabWidget::slotTabSelected)); } UTabWidget::~UTabWidget() { } void UTabWidget::addTab(UWidget * child, const std::string & label) { m_stackWidget->add(child); m_tabBar->addTab(label); if (getTabCount() == 1) { setSelectedIndex(0); } } void UTabWidget::removeTab(int index) { // FIXME:: not yet implemented m_tabBar->removeTab(index); m_stackWidget->remove(index); } std::string UTabWidget::getTabText(int index) const { return m_tabBar->getTabText(index); } UWidget * UTabWidget::getTabWidget(int index) const { return m_stackWidget->getWidget(index); } int UTabWidget::getTabIndex(const std::string & label) const { return m_tabBar->getTabIndex(label); } int UTabWidget::getTabIndex(UWidget * child) const { return m_stackWidget->getIndexOf(child); } static bool ufo_is_recursive = false; void UTabWidget::setSelectedIndex(int index) { if (!ufo_is_recursive) { ufo_is_recursive = true; m_stackWidget->setSelectedIndex(index); m_tabBar->setSelectedIndex(index); ufo_is_recursive = false; } } int UTabWidget::getSelectedIndex() const { return m_stackWidget->getSelectedIndex(); } int UTabWidget::getTabCount() const { return m_stackWidget->getWidgetCount(); } void UTabWidget::slotTabSelected(UTabBar * bar) { setSelectedIndex(bar->getSelectedIndex()); } Index: Makefile.am =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.am 21 Jun 2005 09:26:40 -0000 1.13 --- Makefile.am 24 Oct 2005 15:52:02 -0000 1.14 *************** *** 30,33 **** --- 30,36 ---- widgets/uslider.cpp \ widgets/uspinbox.cpp \ + widgets/ustackwidget.cpp \ + widgets/utabbar.cpp \ + widgets/utabwidget.cpp \ widgets/utextedit.cpp \ widgets/utextwidget.cpp \ --- NEW FILE: ustackwidget.cpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : src/widgets/ustackwidget.hpp begin : Sun Sep 25 2005 $Id: ustackwidget.cpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #include "ufo/widgets/ustackwidget.hpp" using namespace ufo; UFO_IMPLEMENT_CLASS(UStackWidget, UWidget) UStackWidget::UStackWidget() : m_selectedIndex(0) , m_selectionMode(1) { } UStackWidget::UStackWidget(int selectionMode) : m_selectedIndex(0) , m_selectionMode(selectionMode) { } void UStackWidget::setSelectedIndex(int index) { int count = getWidgetCount(); if (m_selectionMode && index < count && index >= 0) { UWidget * oldWidget = getWidget(m_selectedIndex); if (oldWidget) { oldWidget->setVisible(false); } m_selectedIndex = index; getWidget(m_selectedIndex)->setVisible(true); // FIXME: is this necessary? invalidate(); } } int UStackWidget::getSelectedIndex() const { return m_selectedIndex; } void UStackWidget::addImpl(UWidget * w, UObject * constraints, int index) { // stack is from bottom up // FIXME: add reverse showing attribute to UWidget /*if (index == -1) { index = 0; }*/ if (index == -1) { index = getWidgetCount(); } UWidget * oldWidget = getWidget(index); if (m_selectionMode && oldWidget) { oldWidget->setVisible(false); } UWidget::addImpl(w, constraints, index); if (m_selectionMode && index != m_selectedIndex) { w->setVisible(false); } } bool UStackWidget::removeImpl(int index) { return UWidget::removeImpl(index); } UDimension UStackWidget::getContentsSize(const UDimension & maxSize) const { UDimension ret; for (unsigned int i = 0; i < getWidgetCount(); ++i) { UWidget * w = getWidget(i); if (w) { ret.expand(w->getPreferredSize(maxSize)); } } ret.clamp(maxSize); return ret; } --- NEW FILE: utabbar.cpp --- /*************************************************************************** LibUFO - UI For OpenGL copyright : (C) 2001-2005 by Johannes Schmidt email : schmidtjf at users.sourceforge.net ------------------- file : src/widgets/utabbar.hpp begin : Mon Sep 26 2005 $Id: utabbar.cpp,v 1.1 2005/10/24 15:52:02 schmidtjf Exp $ ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ #include "ufo/widgets/utabbar.hpp" #include "ufo/widgets/ucompound.hpp" #include "ufo/events/umouseevent.hpp" #include "ufo/events/ushortcutevent.hpp" #include "ufo/layouts/uboxlayout.hpp" using namespace ufo; UFO_IMPLEMENT_CLASS(UTabBar, UWidget) class UTabBarTab : public UCompound { UFO_STYLE_TYPE(UStyle::CE_TabBarTab) public: UTabBarTab(const std::string & text) : UCompound(text) {} void deselect() { setState(WidgetSelected, false); } void select() { setState(WidgetSelected); } protected: void processMouseEvent(UMouseEvent * e) { switch (e->getType()) { case UEvent::MousePressed: if (UTabBar * bar = dynamic_cast<UTabBar*>(getParent())) { bar->setSelectedIndex(bar->getIndexOf(this)); } else { select(); } e->consume(); break; default: break; } } void processShortcutEvent(UShortcutEvent * e) { if (isEnabled()) { if (UTabBar * bar = dynamic_cast<UTabBar*>(getParent())) { bar->setSelectedIndex(bar->getIndexOf(this)); } else { select(); } e->consume(); } UWidget::processShortcutEvent(e); } UDimension getContentsSize(const UDimension & maxSize) const { UDimension ret(getStyle()->getCompoundPreferredSize( getStyleHints(), getText(), getIcon()) ); if (ret.isValid()) { ret.clamp(maxSize); return ret; } return UDimension::invalid; } }; UTabBar::UTabBar() : m_selectedIndex(-1) { setOrientation(Horizontal); setLayout(new UBoxLayout(Horizontal, 0, 0)); } UTabBar::~UTabBar() { } void UTabBar::addTab(const std::string & label) { UTabBarTab * tab = new UTabBarTab(label); add(tab); } void UTabBar::removeTab(int index) { remove(index); if (index == m_selectedIndex) { setSelectedIndex(0); } } void UTabBar::setSelectedIndex(int index) { if (index == m_selectedIndex) { return; } if (UTabBarTab * tab = dynamic_cast<UTabBarTab*>(getWidget(m_selectedIndex))) { tab->deselect(); } m_selectedIndex = index; if (UTabBarTab * tab = dynamic_cast<UTabBarTab*>(getWidget(index))) { tab->select(); } m_sigSelectionChanged(this); } int UTabBar::getSelectedIndex() const { return m_selectedIndex; } std::string UTabBar::getTabText(int index) const { if (UTabBarTab * tab = dynamic_cast<UTabBarTab*>(getWidget(index))) { return tab->getText(); } return ""; } int UTabBar::getTabIndex(const std::string & label) const { for (unsigned int i = 0; i < getWidgetCount(); ++i) { if (UTabBarTab * tab = dynamic_cast<UTabBarTab*>(getWidget(i))) { if (tab->getText() == label) { return i; } } } return -1; } int UTabBar::getTabCount() const { return getWidgetCount(); } |
|
From: Johannes S. <sch...@us...> - 2005-10-24 15:52:14
|
Update of /cvsroot/libufo/ufo-0.5/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30102/include Modified Files: Makefile.am Log Message: Added tab widget, tab bar and stack widget. Index: Makefile.am =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/Makefile.am,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Makefile.am 21 Jun 2005 09:26:25 -0000 1.27 --- Makefile.am 24 Oct 2005 15:52:02 -0000 1.28 *************** *** 212,215 **** --- 212,218 ---- ufo/widgets/uslider.hpp \ ufo/widgets/uspinbox.hpp \ + ufo/widgets/ustackwidget.hpp \ + ufo/widgets/utabwidget.hpp \ + ufo/widgets/utabbar.hpp \ ufo/widgets/utextedit.hpp \ ufo/widgets/utextwidget.hpp \ |
|
From: Johannes S. <sch...@us...> - 2005-10-21 12:07:04
|
Update of /cvsroot/libufo/ufo-0.5/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19186/src/util Modified Files: ufilearchive.cpp Log Message: Fixed string to c string in isDirectory Index: ufilearchive.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/util/ufilearchive.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ufilearchive.cpp 17 Oct 2005 15:34:48 -0000 1.10 --- ufilearchive.cpp 21 Oct 2005 12:06:55 -0000 1.11 *************** *** 145,149 **** #if defined(UFO_OS_UNIX) struct stat statbuf; ! if (stat(path, &statbuf) == -1) { // FIXME: process strerror(errno)? return false; --- 145,149 ---- #if defined(UFO_OS_UNIX) struct stat statbuf; ! if (stat(path.c_str(), &statbuf) == -1) { // FIXME: process strerror(errno)? return false; |
|
From: Johannes S. <sch...@us...> - 2005-10-18 16:40:03
|
Update of /cvsroot/libufo/ufo-0.5/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28088/src Modified Files: uabstracttoolkit.cpp Log Message: Added ufo_getModuleFileName for relocation support. Removed all LAF code. Changed from map to vector<pair> to match order of appending. Index: uabstracttoolkit.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/uabstracttoolkit.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** uabstracttoolkit.cpp 16 Jul 2005 13:45:25 -0000 1.22 --- uabstracttoolkit.cpp 18 Oct 2005 16:39:24 -0000 1.23 *************** *** 38,41 **** --- 38,43 ---- #include "ufo/usharedlib.hpp" + #include "ufo/util/ufilearchive.hpp" + // pre register font plugins #include "ufo/font/utexturefont.hpp" *************** *** 88,91 **** --- 90,94 ---- m_properties->put("prg_name", prop->get("prg_name")); + m_properties->put("file_name", prop->get("file_name")); } // try GLib code to fill missing values *************** *** 198,208 **** if (plugin.category == "font") { if (UFontPlugin * fontPlugin = dynamic_cast<UFontPlugin*>(pluginBase)) { ! m_fontPlugins[plugin] = fontPlugin; ! } ! } ! ! if (plugin.category == "look_and_feel") { ! if (ULAFPlugin * lafPlugin = dynamic_cast<ULAFPlugin*>(pluginBase)) { ! m_lafPlugins[plugin] = lafPlugin; } } --- 201,205 ---- if (plugin.category == "font") { if (UFontPlugin * fontPlugin = dynamic_cast<UFontPlugin*>(pluginBase)) { ! m_fontPlugins.push_back(std::make_pair(plugin, fontPlugin)); } } *************** *** 211,215 **** if (UVideoPlugin * videoPlugin = dynamic_cast<UVideoPlugin*>(pluginBase)) { ! m_videoPlugins[plugin] = videoPlugin; } } --- 208,212 ---- if (UVideoPlugin * videoPlugin = dynamic_cast<UVideoPlugin*>(pluginBase)) { ! m_videoPlugins.push_back(std::make_pair(plugin, videoPlugin)); } } *************** *** 236,255 **** void UAbstractToolkit::unloadPlugin(UPluginInfo plugin) { ! // FIXME ! // only checks for laf and font plugins ! UPluginBase * pluginImpl; ! pluginImpl = m_fontPlugins[plugin]; ! m_fontPlugins.erase(plugin); ! if (pluginImpl == NULL) { ! pluginImpl = m_lafPlugins[plugin]; ! m_lafPlugins.erase(plugin); } if (pluginImpl != NULL) { plugin.destroy(pluginImpl); if (plugin.lib != NULL) { plugin.lib->unload(); ! delete(plugin.lib); } } --- 233,265 ---- void UAbstractToolkit::unloadPlugin(UPluginInfo plugin) { ! // FIXME: only checks for video and font plugins ! UPluginBase * pluginImpl = NULL; ! for (FontPluginCache::iterator font_iter = m_fontPlugins.begin(); ! font_iter != m_fontPlugins.end(); ! ++font_iter) { ! if ((*font_iter).first == plugin) { ! pluginImpl = (*font_iter).second; ! m_fontPlugins.erase(font_iter); ! break; ! } ! } ! if (!pluginImpl) ! for (VideoPluginCache::iterator video_iter = m_videoPlugins.begin(); ! video_iter != m_videoPlugins.end(); ! ++video_iter) { ! if ((*video_iter).first == plugin) { ! pluginImpl = (*video_iter).second; ! m_videoPlugins.erase(video_iter); ! break; ! } } if (pluginImpl != NULL) { plugin.destroy(pluginImpl); + // Note: pluginImpl is now deleted if (plugin.lib != NULL) { plugin.lib->unload(); ! delete (plugin.lib); } } *************** *** 265,272 **** ret.push_back((*font_iter).first); } ! for (LAFPluginCache::const_iterator laf_iter = m_lafPlugins.begin(); ! laf_iter != m_lafPlugins.end(); ! ++laf_iter) { ! ret.push_back((*laf_iter).first); } return ret; --- 275,282 ---- ret.push_back((*font_iter).first); } ! for (VideoPluginCache::const_iterator video_iter = m_videoPlugins.begin(); ! video_iter != m_videoPlugins.end(); ! ++video_iter) { ! ret.push_back((*video_iter).first); } return ret; *************** *** 515,518 **** --- 525,634 ---- #endif // UFO_OS_WIN32 + // + // The Unix part is taken from public domain project relocbin + // at autopackage.org + static std::string + ufo_getModuleFileName() { + #ifdef UFO_OS_WIN32 + unsigned int buflen; + TCHAR buffer[MAX_PATH]; + buflen = GetModuleFileName(NULL, buffer, MAX_PATH); + return std::string(buffer, buflen); + #else + #define SIZE PATH_MAX + 100 + FILE *f; + size_t address_string_len; + char *address_string, line[SIZE], *found; + + const char * symbol = ""; + + f = fopen ("/proc/self/maps", "r"); + if (f == NULL) + return ""; + + address_string_len = 4; + address_string = (char *) malloc (address_string_len); + found = (char *) NULL; + + while (!feof (f)) { + char *start_addr, *end_addr, *end_addr_end, *file; + void *start_addr_p, *end_addr_p; + size_t len; + + if (fgets (line, SIZE, f) == NULL) + break; + + /* Sanity check. */ + if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL) + continue; + + /* Parse line. */ + start_addr = line; + end_addr = strchr (line, '-'); + file = strchr (line, '/'); + + /* More sanity check. */ + if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-')) + continue; + + end_addr[0] = '\0'; + end_addr++; + end_addr_end = strchr (end_addr, ' '); + if (end_addr_end == NULL) + continue; + + end_addr_end[0] = '\0'; + len = strlen (file); + if (len == 0) + continue; + if (file[len - 1] == '\n') + file[len - 1] = '\0'; + + /* Get rid of "(deleted)" from the filename. */ + len = strlen (file); + if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0) + file[len - 10] = '\0'; + + /* I don't know whether this can happen but better safe than sorry. */ + len = strlen (start_addr); + if (len != strlen (end_addr)) + continue; + + + /* Transform the addresses into a string in the form of 0xdeadbeef, + * then transform that into a pointer. */ + if (address_string_len < len + 3) { + address_string_len = len + 3; + address_string = (char *) realloc (address_string, address_string_len); + } + + memcpy (address_string, "0x", 2); + memcpy (address_string + 2, start_addr, len); + address_string[2 + len] = '\0'; + sscanf (address_string, "%p", &start_addr_p); + + memcpy (address_string, "0x", 2); + memcpy (address_string + 2, end_addr, len); + address_string[2 + len] = '\0'; + sscanf (address_string, "%p", &end_addr_p); + + + if (symbol >= start_addr_p && symbol < end_addr_p) { + found = file; + break; + } + } + + free (address_string); + fclose (f); + + if (found == NULL) { + return ""; + } else { + return found; + } + #endif + } + /** Several parts of this code are taken from the GLib 2.2.1 sources, * Thanks guys! *************** *** 522,546 **** UAbstractToolkit::initMissing() { // - // look and feel - // - if (getenv("UFO_LOOK_AND_FEEL")) { - // overwrite with env var - m_properties->put("look_and_feel", getenv("UFO_LOOK_AND_FEEL")); - } else if (m_properties->get("look_and_feel").empty()) { - // set cross-platform look and feel - m_properties->put("look_and_feel", "theme"); - } - - // FIXME - // should this be here? - if (getenv("UFO_THEME_CONFIG")) { - // overwrite with env var - m_properties->put("theme_config", getenv("UFO_THEME_CONFIG")); - }/* else if (m_properties->get("theme_config").empty()) { - // set cross-platform look and feel config file - m_properties->put("theme_config", "blue.theme"); - }*/ - - // // video driver // --- 638,641 ---- *************** *** 551,566 **** // - // data dir - // - if (getenv("UFO_DATA_DIR")) { - // overwrite with env var - m_properties->put("data_dir", getenv("UFO_DATA_DIR")); - } else if (m_properties->get("data_dir").empty()) { - // set cross-platform font dir - std::string data_dir = UFO_DATADIR; - m_properties->put("data_dir", data_dir); - } - - // // font // --- 646,649 ---- *************** *** 583,586 **** --- 666,710 ---- } + // the modul file name + std::string file_name; + if (getenv("UFO_FILE_NAME")) { + file_name = getenv("UFO_FILE_NAME"); + } else if (m_properties->get("file_name").empty()) { + file_name = ufo_getModuleFileName(); + } + m_properties->put("file_name", file_name); + + // + // data dir + // + if (getenv("UFO_DATA_DIR")) { + // overwrite with env var + m_properties->put("data_dir", getenv("UFO_DATA_DIR")); + } else if (m_properties->get("data_dir").empty()) { + // set cross-platform font dir + std::string data_dir; + #ifndef UFO_OS_WIN32 + if (!file_name.empty()) { + data_dir = UFileArchive::dirName( + UFileArchive::dirName(m_properties->get("file_name")) + ); + data_dir.append("/share/ufo"); + } else { + // FIXME: did not find module filename, try configure data dir + data_dir = UFO_DATADIR; + } + #else + if (!file_name.empty()) { + data_dir = UFileArchive::dirName(m_properties->get("file_name")); + data_dir.append("/data"); + } else { + // FIXME: did not find module filename, try configure data dir + data_dir = UFO_DATADIR; + } + #endif + m_properties->put("data_dir", data_dir); + } + + // temporary variables to check properties std::string tmp_dir; *************** *** 610,618 **** if (tmp_dir.empty()) { ! #ifndef UFO_OS_WIN32 //G_OS_WIN32 m_properties->put("tmp_dir", "/tmp"); ! #else /* G_OS_WIN32 */ m_properties->put("tmp_dir", "C:/windows/temp"); // "C:\\" ! #endif /* G_OS_WIN32 */ } else { m_properties->put("tmp_dir", tmp_dir); --- 734,742 ---- if (tmp_dir.empty()) { ! #ifndef UFO_OS_WIN32 m_properties->put("tmp_dir", "/tmp"); ! #else // UFO_OS_WIN32 m_properties->put("tmp_dir", "C:/windows/temp"); // "C:\\" ! #endif // !UFO_OS_WIN32 } else { m_properties->put("tmp_dir", tmp_dir); |
|
From: Johannes S. <sch...@us...> - 2005-10-18 16:40:03
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28088/include/ufo Modified Files: uabstracttoolkit.hpp Log Message: Added ufo_getModuleFileName for relocation support. Removed all LAF code. Changed from map to vector<pair> to match order of appending. Index: uabstracttoolkit.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/uabstracttoolkit.hpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** uabstracttoolkit.hpp 5 Jul 2005 11:27:41 -0000 1.14 --- uabstracttoolkit.hpp 18 Oct 2005 16:39:24 -0000 1.15 *************** *** 116,124 **** private: // Private attributes UProperties * m_properties; ! typedef std::map<UPluginInfo, UFontPlugin*> FontPluginCache; ! typedef std::map<UPluginInfo, ULAFPlugin*> LAFPluginCache; ! typedef std::map<UPluginInfo, UVideoPlugin*> VideoPluginCache; FontPluginCache m_fontPlugins; - LAFPluginCache m_lafPlugins; VideoPluginCache m_videoPlugins; }; --- 116,122 ---- private: // Private attributes UProperties * m_properties; ! typedef std::list<std::pair<UPluginInfo, UFontPlugin*> > FontPluginCache; ! typedef std::list<std::pair<UPluginInfo, UVideoPlugin*> > VideoPluginCache; FontPluginCache m_fontPlugins; VideoPluginCache m_videoPlugins; }; |
|
From: Johannes S. <sch...@us...> - 2005-10-18 15:59:58
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16586/include/ufo Modified Files: uvolatiledata.hpp Log Message: Changed UVolatileData to auto-registering at UDisplay. Index: uvolatiledata.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/uvolatiledata.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** uvolatiledata.hpp 21 May 2005 15:17:35 -0000 1.3 --- uvolatiledata.hpp 18 Oct 2005 15:59:47 -0000 1.4 *************** *** 45,48 **** --- 45,49 ---- public: // constructor UVolatileData(UDisplay * display = NULL); + virtual ~UVolatileData(); public: // Public virtual methods |