*
* \author Angus Leeming
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "xforms_resize.h"
-#include "support/LAssert.h"
+
+#include <boost/assert.hpp>
+
#include <algorithm> // std::max. Use FL_max in .c code...
-#include FORMS_H_LOCATION
+#include "lyx_forms.h"
+
+namespace lyx {
+namespace frontend {
namespace {
if (ob->objclass == FL_BUTTON &&
(ob->type == FL_RETURN_BUTTON || ob->type == FL_MENU_BUTTON))
- sw += FL_min(0.6f * ob->h, 0.6f * ob->w) - 1;
+ sw += (int)FL_min(0.6f * ob->h, 0.6f * ob->w) - 1;
if (ob->objclass == FL_BUTTON && ob->type == FL_LIGHTBUTTON)
sw += FL_LIGHTBUTTON_MINSIZE + 1;
if (sw <= (ob->w - 2 * (bw + xm)) && sh <= (ob->h - 2 * (bw + ym)))
continue;
- if ((osize = ob->w - 2 * (bw + xm)) <= 0)
+ if ((osize = ob->w - 2 * (int)(bw + xm)) <= 0)
osize = 1;
xfactor = (float) sw / (float)osize;
- if ((osize = ob->h - 2 * (bw + ym)) <= 0)
+ if ((osize = ob->h - 2 * (int)(bw + ym)) <= 0)
osize = 1;
yfactor = (float) sh / osize;
double get_tabfolder_scale_to_fit(FL_OBJECT * folder)
{
- lyx::Assert(folder && folder->objclass == FL_TABFOLDER);
+ BOOST_ASSERT(folder && folder->objclass == FL_TABFOLDER);
fl_freeze_form(folder->form);
int const saved_folder_id = fl_get_folder_number(folder);
void scale_tabfolder_horizontally(FL_OBJECT * folder, double factor)
{
- lyx::Assert(folder && folder->objclass == FL_TABFOLDER);
+ BOOST_ASSERT(folder && folder->objclass == FL_TABFOLDER);
fl_freeze_form(folder->form);
int const saved_folder_id = fl_get_folder_number(folder);
double get_scale_to_fit(FL_FORM * form)
{
- lyx::Assert(form);
+ BOOST_ASSERT(form);
double factor = get_scaling_factor(form);
for (FL_OBJECT * ob = form->first; ob; ob = ob->next) {
void scale_form_horizontally(FL_FORM * form, double factor)
{
- lyx::Assert(form);
+ BOOST_ASSERT(form);
if (factor <= 1.0)
return;
scale_tabfolder_horizontally(ob, factor);
}
}
+
+} // namespace frontend
+} // namespace lyx