]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xforms_resize.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / xforms_resize.C
index 38f514d358c75eeeef03fa265c7d84b661b4469d..d84aa560be7e402de64b83151bdc353ee1a20f26 100644 (file)
@@ -5,16 +5,21 @@
  *
  * \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 {
 
@@ -50,7 +55,7 @@ double get_scaling_factor(FL_FORM * form)
 
            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;
@@ -58,11 +63,11 @@ double get_scaling_factor(FL_FORM * form)
            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;
 
@@ -93,7 +98,7 @@ double get_scaling_factor(FL_FORM * form)
 
 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);
@@ -115,7 +120,7 @@ double get_tabfolder_scale_to_fit(FL_OBJECT * 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);
@@ -136,7 +141,7 @@ void scale_tabfolder_horizontally(FL_OBJECT * folder, double factor)
 
 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) {
@@ -150,7 +155,7 @@ double get_scale_to_fit(FL_FORM * form)
 
 void scale_form_horizontally(FL_FORM * form, double factor)
 {
-       lyx::Assert(form);
+       BOOST_ASSERT(form);
 
        if (factor <= 1.0)
                return;
@@ -162,3 +167,6 @@ void scale_form_horizontally(FL_FORM * form, double factor)
                        scale_tabfolder_horizontally(ob, factor);
        }
 }
+
+} // namespace frontend
+} // namespace lyx