summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2021-12-13 18:32:11 +0100
committerMatthias Melcher <github@matthiasm.com>2021-12-13 18:44:33 +0100
commit21c328f0c556195ea8375cb40ad3de6e14fc429d (patch)
treef41a9d4213843a4c0cd58de1954c0f360adde053 /fluid
parente76611a1fe3c49e66c42d9d4f0e2c995fa7f6f5e (diff)
#322: remove Fluid's dependency on fltk_forms.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/CMakeLists.txt2
-rw-r--r--fluid/Makefile2
-rw-r--r--fluid/file.cxx39
3 files changed, 41 insertions, 2 deletions
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt
index a9b3af1a7..ed1cf94b6 100644
--- a/fluid/CMakeLists.txt
+++ b/fluid/CMakeLists.txt
@@ -106,7 +106,7 @@ else ()
add_executable (fluid WIN32 ${CPPFILES} ${HEADERFILES})
endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
-target_link_libraries (fluid fltk fltk_images fltk_forms)
+target_link_libraries (fluid fltk fltk_images)
if (FLTK_HAVE_CAIRO)
fl_target_link_directories (fluid PRIVATE "${PKG_CAIRO_LIBRARY_DIRS}")
endif (FLTK_HAVE_CAIRO)
diff --git a/fluid/Makefile b/fluid/Makefile
index 8fd23d3bf..32ad525d4 100644
--- a/fluid/Makefile
+++ b/fluid/Makefile
@@ -60,7 +60,7 @@ all: $(FLUID) fluid$(EXEEXT)
fluid$(EXEEXT): $(OBJECTS) $(LIBNAME) $(FLLIBNAME) \
$(IMGLIBNAME)
echo Linking $@...
- $(CXX) $(ARCHFLAGS) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKFLTKFORMS) $(LINKFLTKIMG) $(LDFLAGS) $(LDLIBS)
+ $(CXX) $(ARCHFLAGS) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKFLTKIMG) $(LDFLAGS) $(LDLIBS)
$(OSX_ONLY) $(RM) -r -f fluid.app
$(OSX_ONLY) mkdir -p fluid.app/Contents/MacOS fluid.app/Contents/Resources
$(OSX_ONLY) $(INSTALL_BIN) fluid fluid.app/Contents/MacOS
diff --git a/fluid/file.cxx b/fluid/file.cxx
index 2732ae26b..87125bd8d 100644
--- a/fluid/file.cxx
+++ b/fluid/file.cxx
@@ -710,6 +710,45 @@ static const char *class_matcher[] = {
"24","Fl_Value_Slider",
0};
+
+/**
+ Copied from forms_compatibility.cxx so we don't have to link to fltk_forms.
+ */
+void Fl_Group::forms_end() {
+ // set the dimensions of a group to surround contents
+ if (children() && !w()) {
+ Fl_Widget*const* a = array();
+ Fl_Widget* o = *a++;
+ int rx = o->x();
+ int ry = o->y();
+ int rw = rx+o->w();
+ int rh = ry+o->h();
+ for (int i=children_-1; i--;) {
+ o = *a++;
+ if (o->x() < rx) rx = o->x();
+ if (o->y() < ry) ry = o->y();
+ if (o->x()+o->w() > rw) rw = o->x()+o->w();
+ if (o->y()+o->h() > rh) rh = o->y()+o->h();
+ }
+ x(rx);
+ y(ry);
+ w(rw-rx);
+ h(rh-ry);
+ }
+ // flip all the children's coordinate systems:
+ if (fdesign_flip) {
+ Fl_Widget* o = (type()>=FL_WINDOW) ? this : window();
+ int Y = o->h();
+ Fl_Widget*const* a = array();
+ for (int i=children(); i--;) {
+ Fl_Widget* ow = *a++;
+ int newy = Y-ow->y()-ow->h();
+ ow->y(newy);
+ }
+ }
+ end();
+}
+
/**
Read a XForms design file.
.fl and .fd file start with the same header. Fluid can recognize .fd XForms