From 162946f20eda5fe3422a52cd5e33af88c40029b5 Mon Sep 17 00:00:00 2001
From: Bach Nguyen <bach5000@gmail.com>
Date: Mon, 19 Nov 2018 19:25:49 +0000
Subject: Fix build


diff --git a/Makefile b/Makefile
index 9b4cc30..8e66ddf 100644
--- a/Makefile
+++ b/Makefile
@@ -1 +1,131 @@
-Makefile_RELEASE
\ No newline at end of file
+## Haiku Generic Makefile v2.6 ##
+
+## Fill in this file to specify the project being created, and the referenced
+## Makefile-Engine will do all of the hard work for you. This handles any
+## architecture of Haiku.
+
+# The name of the binary.
+NAME = gadgeteer
+
+# The type of binary, must be one of:
+#	APP:	Application
+#	SHARED:	Shared library or add-on
+#	STATIC:	Static library archive
+#	DRIVER: Kernel driver
+TYPE = APP
+
+# 	If you plan to use localization, specify the application's MIME signature.
+APP_MIME_SIG = 
+
+#	The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are
+#	so that Pe and Eddie can fill them in for you.
+#%{
+# @src->@ 
+
+#	Specify the source files to use. Full paths or paths relative to the 
+#	Makefile can be included. All files, regardless of directory, will have
+#	their object files created in the common object directory. Note that this
+#	means this Makefile will not work correctly if two source files with the
+#	same name (source.c or source.cpp) are included from different directories.
+#	Also note that spaces in folder names do not work well with this Makefile.
+SRCS = Main.cpp  \
+	 Panel.cpp  \
+	 ReadYaml.cpp  \
+	 WMPanel.cpp  \
+	 WMSlider.cpp  \
+
+#	Specify the resource definition files to use. Full or relative paths can be
+#	used.
+RDEFS = gadgeteer.rdef
+	 
+
+
+#	Specify the resource files to use. Full or relative paths can be used.
+#	Both RDEFS and RSRCS can be utilized in the same Makefile.
+RSRCS =
+
+
+# End Pe/Eddie support.
+# @<-src@ 
+#%}
+
+#%}
+
+#	Specify libraries to link against.
+#	There are two acceptable forms of library specifications:
+#	-	if your library follows the naming pattern of libXXX.so or libXXX.a,
+#		you can simply specify XXX for the library. (e.g. the entry for
+#		"libtracker.so" would be "tracker")
+#
+#	-	for GCC-independent linking of standard C++ libraries, you can use
+#		$(STDCPPLIBS) instead of the raw "stdc++[.r4] [supc++]" library names.
+#
+#	- 	if your library does not follow the standard library naming scheme,
+#		you need to specify the path to the library and it's name.
+#		(e.g. for mylib.a, specify "mylib.a" or "path/mylib.a")
+LIBS = $(STDCPPLIBS) be root libyaml.a
+#	Specify additional paths to directories following the standard libXXX.so
+#	or libXXX.a naming scheme. You can specify full paths or paths relative
+#	to the Makefile. The paths included are not parsed recursively, so
+#	include all of the paths where libraries must be found. Directories where
+#	source files were specified are	automatically included.
+LIBPATHS = 
+
+#	Additional paths to look for system headers. These use the form
+#	"#include <header>". Directories that contain the files in SRCS are
+#	NOT auto-included here.
+SYSTEM_INCLUDE_PATHS =  
+
+#	Additional paths paths to look for local headers. These use the form
+#	#include "header". Directories that contain the files in SRCS are
+#	automatically included.
+LOCAL_INCLUDE_PATHS =
+
+#	Specify the level of optimization that you want. Specify either NONE (O0),
+#	SOME (O1), FULL (O2), or leave blank (for the default optimization level).
+OPTIMIZE :=
+
+# 	Specify the codes for languages you are going to support in this
+# 	application. The default "en" one must be provided too. "make catkeys"
+# 	will recreate only the "locales/en.catkeys" file. Use it as a template
+# 	for creating catkeys for other languages. All localization files must be
+# 	placed in the "locales" subdirectory.
+LOCALES = 
+
+#	Specify all the preprocessor symbols to be defined. The symbols will not
+#	have their values set automatically; you must supply the value (if any) to
+#	use. For example, setting DEFINES to "DEBUG=1" will cause the compiler
+#	option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass
+#	"-DDEBUG" on the compiler's command line.
+DEFINES = 
+
+#	Specify the warning level. Either NONE (suppress all warnings),
+#	ALL (enable all warnings), or leave blank (enable default warnings).
+WARNINGS = 
+
+#	With image symbols, stack crawls in the debugger are meaningful.
+#	If set to "TRUE", symbols will be created.
+SYMBOLS := 
+
+#	Includes debug information, which allows the binary to be debugged easily.
+#	If set to "TRUE", debug info will be created.
+DEBUGGER := 
+
+#	Specify any additional compiler flags to be used.
+COMPILER_FLAGS = -fpermissive
+
+#	Specify any additional linker flags to be used.
+LINKER_FLAGS = 
+
+#	(Only used when "TYPE" is "DRIVER"). Specify the desired driver install
+#	location in the /dev hierarchy. Example:
+#		DRIVER_PATH = video/usb
+#	will instruct the "driverinstall" rule to place a symlink to your driver's
+#	binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will
+#	appear at /dev/video/usb when loaded. The default is "misc".
+DRIVER_PATH = 
+
+## Include the Makefile-Engine
+DEVEL_DIRECTORY := \
+	$(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY)
+include $(DEVEL_DIRECTORY)/etc/makefile-engine
diff --git a/WMSlider.cpp b/WMSlider.cpp
index 517a2e3..a2a045b 100644
--- a/WMSlider.cpp
+++ b/WMSlider.cpp
@@ -32,15 +32,16 @@ class _WMCntrlSldr : public BSlider
 {
   friend class LSLider;
   public:
-	_WMCntrlSldr(BRect frame, char *title,
-			BStringView *sv,
-			long min, long max, long * valoc,
-			WMSlider * owner);
-	_WMCntrlSldr(BRect frame, char *title,
+		_WMCntrlSldr(BRect frame, char *title,
 			BStringView *sv,
 			float scaling, float offset,
 			int32 places, float * valoc,
 			WMSlider * owner);
+		_WMCntrlSldr(BRect frame, char *title,
+			BStringView *sv,
+			long int min, long int max, long int* valoc,
+			WMSlider * owner);
+
 	void SetValue(int32 v);
 	void SetFValue(float v);
 	float FValue() {return fvalp? *fvalp : NAN;}
@@ -57,7 +58,7 @@ class _WMCntrlSldr : public BSlider
 
 // Note -- 'title' is currently always NULL (Border label used)
 _WMCntrlSldr::_WMCntrlSldr(BRect frame, char *title, 
-			BStringView *sv, long min, long max, long * valoc,
+			BStringView *sv, long int min, long int max, long int *valoc,
 			WMSlider *owner) :
 	BSlider(frame, "slider", title,
 			new BMessage('smup'), min, max, B_BLOCK_THUMB,
@@ -74,7 +75,7 @@ _WMCntrlSldr::_WMCntrlSldr(BRect frame, char *title,
 			BStringView *sv,
 			float scaling, float offset,
 			int32 places, float * valoc,
-			WMSlider * owner) :
+			WMSlider *owner) :
 	BSlider(frame, "slider", title,
 			new BMessage('smup'), 0, 1000, B_BLOCK_THUMB,
 			B_FOLLOW_ALL_SIDES),
@@ -165,7 +166,7 @@ WMSlider::WMSlider(BRect view_frame, int32 min, int32 max,
 	BRect sr(SLIDER_X_PAD, txtspace,
 		 view_bound.Width()-SLIDER_X_PAD - t->Bounds().Width(),
 		  txtspace+10);
-	s = new _WMCntrlSldr(sr, NULL, t, min, max, valoc, this);
+	s = new _WMCntrlSldr(sr, NULL, t, (long int)min, (long int)max, (long int*)valoc, this);
 	s->ResizeTo(s->Bounds().Width(), s->ThumbFrame().Height()+2*SLIDER_Y_PAD);
 	b->AddChild(s);
 	t->MoveTo(s->Frame().RightTop());
diff --git a/demo.sh b/demo.sh
new file mode 100644
index 0000000..52d6405
--- /dev/null
+++ b/demo.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+# A short script to illustrate the use of the "gadgeteer"
+# command-line app.
+
+# A function is needed to let the shell read the output:
+useOutput() {
+  while true; do
+	read TITLE
+	if [ $? != 0 ]; then
+	  return; fi
+	read FIRST
+	read LAST
+	read AGE
+	read CHECK
+	read BUTTON
+	if [ "$BUTTON" ]; then echo "You pressed the button"; continue; fi
+	echo "The name is $TITLE $FIRST $LAST"
+	echo "Age is $AGE"
+	if [ "$CHECK" ]; then echo "and Married"; fi
+  done
+}
+
+# Using shell variables can be convenient:
+  INIT="Billy"
+  
+# The demonstration command line:
+gadgeteer {title: DEMO, label: this is a demonstration, \
+     label: of some gadgeteer features, \
+     menu: [Mr, Mrs, Miss, Ms., Master, Sir, Lady, President, Their Majesty], \
+     width: 300, div: 80, pos: right, textcontrol: {label: First Name, init: $INIT}, \
+     pos: below, textcontrol: LastName, \
+     slider: {label: Age, min: 1, max: 110, init: 21}, \
+     checkbox: {label: Married, init: off}, \
+     button: {label: PUSH ME, width: 50}} | useOutput
+     
+# The command arguments are a YAML-syntax string and thus must be enclosed
+# in braces.  Each 'Directive' entry is a "key: value" pair, separated
+# by commas.  The space after a colon or comma is mandatory.
+
+# By default, items are stacked vertically.  The "pos: right" resets this
+# to put following items to the right of the first, the "pos: below" resets
+# again.  Note that the last item is vertically aligned with the previous.
+# The menu has a list of items as its value; most of the other controls have
+# extended parameter sets as their values.  The "div" global parameter
+# (currently) only applies to the textcontrol divider position.
-- 
2.19.0

