Skip to content

Commit

Permalink
Merge pull request #15 from deech/Fluid
Browse files Browse the repository at this point in the history
Fluid Generator.
  • Loading branch information
deech committed Oct 8, 2015
2 parents 2a110f3 + 4ab0df3 commit 88e79db
Show file tree
Hide file tree
Showing 117 changed files with 5,662 additions and 4,352 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ dist/*
/c-src/cmake_install.cmake
/c-src/libfltkdyn.so
/cmake_install.cmake
/src/Fluid/Parser
/src/Fluid/Parser.hi
/src/Fluid/Types.hi
/TAGS
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Abbreviated installation instructions are for Linux and Mac are:
cabal install
```

- Test your installation by invoking: 'fltkhs-hello-world'.
- Test your installation by invoking: 'fltkhs-arc'.

The rest of the documentation (including installation instructions for Windows and API usage) is located in the [FLTKHS module] [3]. This is the primary module that needs to beimported by every Fltkhs app and the entry point into the application.
The rest of the documentation (including installation instructions for Windows and API usage) is located in the [FLTKHS module] [3]. This is the primary module that needs to be imported by every Fltkhs app and the entry point into the application.


[1]: http://www.fltk.org/index.php "FLTK"
Expand Down
5 changes: 3 additions & 2 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ myBuildHook pkg_descr local_bld_info user_hooks bld_flags =
verbosity = fromFlag (buildVerbosity bld_flags)
with_in_place
= local_bld_info{withPackageDB =
withPackageDB local_bld_info ++ [SpecificPackageDB dbFile]}
withPackageDB local_bld_info ++ [SpecificPackageDB dbFile]
}
pref = buildDir local_bld_info
withAllComponentsInBuildOrder pkg_descr with_in_place $
\ comp clbi ->
Expand Down Expand Up @@ -216,7 +217,7 @@ copyCBindings pkg_descr lbi uhs flags = do
case buildOS of
Linux -> rawSystemExit (fromFlag $ copyVerbosity flags) "cp"
["c-lib/libfltkcdyn.so", libPref]
_ -> return ()


myCleanHook pd x uh cf = do
rawSystemExit normal "make" ["clean"]
Expand Down
1 change: 1 addition & 0 deletions c-examples/sanity_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <Fl_ClockC.h>
#include <Fl_Color_ChooserC.h>
#include <Fl_CounterC.h>
#include <Fl_SpinnerC.h>
#include <Fl_DeviceC.h>
#include <Fl_Double_WindowC.h>
#include <Fl_DialC.h>
Expand Down
3 changes: 2 additions & 1 deletion c-src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SET(SourceFiles
Fl_RollerC.cpp
Fl_DialC.cpp
Fl_CounterC.cpp
Utils.cpp
UtilsC.cpp
xC.cpp
fl_utf8C.cpp
glC.cpp
Expand Down Expand Up @@ -74,6 +74,7 @@ SET(SourceFiles
fl_show_colormapC.cpp
Fl_Single_WindowC.cpp
Fl_SliderC.cpp
Fl_SpinnerC.cpp
Fl_Sys_Menu_BarC.cpp
Fl_TableC.cpp
Fl_Table_RowC.cpp
Expand Down
11 changes: 11 additions & 0 deletions c-src/Fl_AskC.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
#include "Fl_CallbackC.h"
EXPORT {
#endif
#ifndef INTERNAL_LINKAGE
typedef enum Fl_Beep {
FL_BEEP_DEFAULT = 0,
FL_BEEP_MESSAGE = 1,
FL_BEEP_ERROR = 2,
FL_BEEP_QUESTION = 3,
FL_BEEP_PASSWORD = 4,
FL_BEEP_NOTIFICATION = 5
} Fl_Beep;
#endif

FL_EXPORT_C(void,flc_beep)();
FL_EXPORT_C(void,flc_beep_with_type)(int type);
FL_EXPORT_C(void,flc_message)(const char* message);
Expand Down
72 changes: 63 additions & 9 deletions c-src/Fl_CallbackC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,22 @@ C_to_Fl_Callback::C_to_Fl_Callback(fl_Callback* callback, void* user_data){
this->user_data = user_data;
}
void C_to_Fl_Callback::set_callback(Fl_File_Chooser* c){
c->callback(intercept, this);
if (this->callback) {
c->callback(intercept, this);
}
else {
void* p = 0;
c->callback(NULL,p);
}
}
void C_to_Fl_Callback::set_callback(Fl_Menu_Item* item){
item->callback(intercept,this);
if (this->callback) {
item->callback(intercept, this);
}
else {
void* p = 0;
item->callback(NULL,p);
}
}
void C_to_Fl_Callback::set_callback(Fl_Text_Buffer* b){
b->transcoding_warning_action = intercept;
Expand All @@ -47,25 +59,67 @@ void C_to_Fl_Callback::set_user_data(void* user_data){
this->user_data = user_data;
}
int C_to_Fl_Callback::menu_insert(Fl_Menu_Item* item, int index, char* name, int shortcut, int flags){
return item->insert(index,name,shortcut,intercept,this,flags);
if (this->callback) {
return item->insert(index,name,shortcut,intercept,this,flags);
}
else {
void* p = 0;
return item->insert(index,name,shortcut,NULL,p,flags);
}
}
int C_to_Fl_Callback::menu_insert(Fl_Menu_* menu_, int index, char* name, int shortcut, int flags){
return menu_->insert(index,name,shortcut,intercept,this,flags);
if (this->callback) {
return menu_->insert(index,name,shortcut,intercept,this,flags);
}
else {
void* p = 0;
return menu_->insert(index,name,shortcut,NULL,p,flags);
}
}
int C_to_Fl_Callback::menu_insert(Fl_Menu_* menu_, int index, char* name, char* shortcut, int flags){
return menu_->insert(index,name,shortcut,intercept,this,flags);
if (this->callback) {
return menu_->insert(index,name,shortcut,intercept,this,flags);
}
else {
void* p = 0;
return menu_->insert(index,name,shortcut,NULL,p,flags);
}
}
int C_to_Fl_Callback::menu_add(Fl_Menu_Item* item, char* name, int shortcut, int flags){
return item->add(name, shortcut, intercept, this, flags);
if (this->callback) {
return item->add(name, shortcut, intercept, this, flags);
}
else {
void* p = 0;
return item->add(name, shortcut, NULL, p, flags);
}
}
int C_to_Fl_Callback::menu_add(Fl_Menu_Item* item, char* name, char* shortcut, int flags){
return item->add(name, shortcut, intercept, this, flags);
if (this->callback) {
return item->add(name, shortcut, intercept, this, flags);
}
else {
void* p = 0;
return item->add(name, shortcut, NULL, p, flags);
}
}
int C_to_Fl_Callback::menu_add(Fl_Menu_* menu_, char* name, char* shortcut, int flags){
return menu_->add(name,shortcut,intercept,this,flags);
if (this->callback) {
return menu_->add(name,shortcut,intercept,this,flags);
}
else {
void* p = 0;
return menu_->add(name,shortcut,NULL,p,flags);
}
}
int C_to_Fl_Callback::menu_add(Fl_Menu_* menu_, char* name, int shortcut, int flags){
return menu_->add(name,shortcut,intercept,this,flags);
if (this->callback) {
return menu_->add(name,shortcut,intercept,this,flags);
}
else {
void* p = 0;
return menu_->add(name,shortcut,NULL,p,flags);
}
}
void C_to_Fl_Callback::runCallback(Fl_Widget* w) {
(*callback)((fl_Widget) w, user_data);
Expand Down
2 changes: 1 addition & 1 deletion c-src/Fl_ChoiceC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Fl_ChoiceC.h"
#include "Utils.h"
#include "UtilsC.h"
#ifdef __cplusplus
EXPORT {
#endif
Expand Down
14 changes: 10 additions & 4 deletions c-src/Fl_Color_ChooserC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,17 @@ EXPORT {
FL_EXPORT_C(void,Fl_Color_Chooser_rgb2hsv)(double R,double G,double B,double* H,double* S,double* V){
Fl_Color_Chooser::rgb2hsv(R,G,B,*H,*S,*V);
}
FL_EXPORT_C(int, flc_color_chooser)(const char* name, double r, double g, double b){
return fl_color_chooser(name,r,g,b);
FL_EXPORT_C(int, flc_color_chooser)(const char* name, double* r, double* g, double* b){
return fl_color_chooser(name,*r,*g,*b);
}
FL_EXPORT_C(int, flc_color_chooser_with_m)(const char* name, double r, double g, double b, int m){
return fl_color_chooser(name,r,g,b,m);
FL_EXPORT_C(int, flc_color_chooser_with_m)(const char* name, double* r, double* g, double* b, int m){
return fl_color_chooser(name,*r,*g,*b,m);
}
FL_EXPORT_C(int, flc_color_chooser_with_uchar)(const char* name, uchar* r, uchar* g, uchar* b){
return fl_color_chooser(name,*r,*g,*b);
}
FL_EXPORT_C(int, flc_color_chooser_with_uchar_m)(const char* name, uchar* r, uchar* g, uchar* b, int m){
return fl_color_chooser(name,*r,*g,*b,m);
}
#ifdef __cplusplus
}
Expand Down
8 changes: 5 additions & 3 deletions c-src/Fl_Color_ChooserC.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ EXPORT {
FL_EXPORT_C(fl_Widget*, Fl_Color_Chooser_array)(fl_Color_Chooser color_chooser);
FL_EXPORT_C(fl_Widget, Fl_Color_Chooser_child)(fl_Color_Chooser color_chooser, int n);

FL_EXPORT_C(int,Fl_Color_Chooser_mode)(fl_Color_Chooser color_chooser);
FL_EXPORT_C(int,Fl_Color_Chooser_mode)(fl_Color_Chooser color_chooser);
FL_EXPORT_C(void,Fl_Color_Chooser_set_mode)(fl_Color_Chooser color_chooser,int newMode);
FL_EXPORT_C(double,Fl_Color_Chooser_hue)(fl_Color_Chooser color_chooser);
FL_EXPORT_C(double,Fl_Color_Chooser_saturation)(fl_Color_Chooser color_chooser);
Expand All @@ -138,8 +138,10 @@ EXPORT {
FL_EXPORT_C(void,Fl_Color_Chooser_rgb2hsv)(double R, double G, double B, double* H, double* S, double* V);
FL_EXPORT_C(fl_Color_Chooser,Fl_Color_Chooser_New)(int x, int y, int w, int h);
FL_EXPORT_C(fl_Color_Chooser,Fl_Color_Chooser_New_WithLabel)(int x, int y, int w, int h, const char* t);
FL_EXPORT_C(int, flc_color_chooser)(const char* name, double r, double g, double b);
FL_EXPORT_C(int, flc_color_chooser_with_m)(const char* name, double r, double g, double b, int m);
FL_EXPORT_C(int, flc_color_chooser)(const char* name, double* r, double* g, double* b);
FL_EXPORT_C(int, flc_color_chooser_with_m)(const char* name, double* r, double* g, double* b, int m);
FL_EXPORT_C(int, flc_color_chooser_with_uchar)(const char* name, uchar* r, uchar* g, uchar* b);
FL_EXPORT_C(int, flc_color_chooser_with_uchar_m)(const char* name, uchar* r, uchar* g, uchar* b, int m);
#ifdef __cplusplus
}
#endif
Expand Down
8 changes: 7 additions & 1 deletion c-src/Fl_CounterC.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#include "FL/Fl_Simple_Counter.H"
#include "Fl_CallbackC.h"
EXPORT {
#endif
#ifndef INTERNAL_LINKAGE
typedef enum Counter_Type {
FL_NORMAL_COUNTERC = 0,
FL_SIMPLE_COUNTERC = 1
} Counter_Type;
#endif
FL_EXPORT_C(fl_Group, Fl_Counter_parent)(fl_Counter counter);
FL_EXPORT_C(void, Fl_Counter_set_parent)(fl_Counter counter, fl_Group grp);
Expand Down Expand Up @@ -92,7 +98,7 @@ EXPORT {
FL_EXPORT_C(fl_Window, Fl_Counter_top_window)(fl_Counter counter);
FL_EXPORT_C(fl_Window , Fl_Counter_top_window_offset)(fl_Counter counter, int* xoff, int* yoff);
FL_EXPORT_C(fl_Gl_Window, Fl_Counter_as_gl_window)(fl_Counter counter);
FL_EXPORT_C(void, Fl_Counter_resize)(fl_Table table,int X, int Y, int W, int H);
FL_EXPORT_C(void, Fl_Counter_resize)(fl_Counter counter ,int X, int Y, int W, int H);

/* Inherited from Fl_Valuator */
FL_EXPORT_C(void, Fl_Counter_bounds)(fl_Counter counter, double a, double b);
Expand Down
8 changes: 8 additions & 0 deletions c-src/Fl_DialC.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
#include "Fl_CallbackC.h"
EXPORT {
#endif
#ifndef INTERNAL_LINKAGE
typedef enum Dial_Type {
FL_NORMAL_DIALC = 0,
FL_LINE_DIALC = 1,
FL_FILL_DIALC = 2
} Dial_Type;
#endif

FL_EXPORT_C(fl_Group, Fl_Dial_parent)(fl_Dial dial);
FL_EXPORT_C(void, Fl_Dial_set_parent)(fl_Dial dial, fl_Group grp);
FL_EXPORT_C(uchar, Fl_Dial_type)(fl_Dial dial);
Expand Down
3 changes: 2 additions & 1 deletion c-src/Fl_EnumerationsC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifdef __cplusplus
#include "Fl_EnumerationsC.h"
EXPORT {
#endif
#endif
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_ROUND_UP_BOXC)(){ return fl_define_FL_ROUND_UP_BOX();}
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_SHADOW_BOXC)(){ return fl_define_FL_SHADOW_BOX();}
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_ROUNDED_BOXC)(){ return fl_define_FL_ROUNDED_BOX();}
Expand All @@ -13,6 +13,7 @@ EXPORT {
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_OVAL_BOXC)(){ return fl_define_FL_OVAL_BOX(); }
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_PLASTIC_UP_BOXC)(){ return fl_define_FL_PLASTIC_UP_BOX();}
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_GTK_UP_BOXC)(){ return fl_define_FL_GTK_UP_BOX();}
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_GLEAM_UP_BOXC)(){ return fl_define_FL_GLEAM_UP_BOX();}
FL_EXPORT_C(Fl_Boxtype, fl_boxC)(Fl_Boxtype b) { return fl_box(b);}
FL_EXPORT_C(Fl_Boxtype, fl_downC)(Fl_Boxtype b) { return fl_down(b);}
FL_EXPORT_C(Fl_Boxtype, fl_frameC)(Fl_Boxtype b) { return fl_frame(b);}
Expand Down
16 changes: 14 additions & 2 deletions c-src/Fl_EnumerationsC.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ EXPORT {
typedef enum Fl_Tree_Select{
FL_TREE_SELECT_NONE=0,
FL_TREE_SELECT_SINGLE=1,
FL_TREE_SELECT_MULTI=2
FL_TREE_SELECT_MULTI=2,
FL_TREE_SELECT_SINGLE_DRAGGABLE=3
}Fl_Tree_Select;
#if FLTK_ABI_VERSION >= 10302
typedef enum Fl_Tree_Item_Reselect_Mode{
Expand All @@ -81,14 +82,15 @@ EXPORT {
}Fl_Tree_Item_Draw_Mode;
#endif /*FLTK_ABI_VERSION*/
#define FL_Button 0xfee8
#define FL_Clear 0xff0b
#define FL_BackSpace 0xff08
#define FL_Tab 0xff09
#define FL_Iso_Key 0xff0c
#define FL_Enter 0xff0d
#define FL_Pause 0xff13
#define FL_Scroll_Lock 0xff14
#define FL_Escape 0xff1b
#define FL_Kana 0xff2e
#define FL_Kana 0xff2e
#define FL_Eisu 0xff2f
#define FL_Yen 0xff30
#define FL_JIS_Underscore 0xff31
Expand Down Expand Up @@ -253,6 +255,15 @@ EXPORT {
#define FL_GTK_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOXC()+7)
#define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOXC()+8)
#define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOXC()+9)
#define FL_GLEAM_UP_BOX fl_define_FL_GLEAM_UP_BOXC()
#define FL_GLEAM_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+1)
#define FL_GLEAM_UP_FRAME (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+2)
#define FL_GLEAM_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+3)
#define FL_GLEAM_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+4)
#define FL_GLEAM_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+5)
#define FL_GLEAM_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+6)
#define FL_GLEAM_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GLEAM_UP_BOXC()+7)

#define FL_FRAME FL_ENGRAVED_FRAME
#define FL_FRAME_BOX FL_ENGRAVED_BOX
#define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX
Expand Down Expand Up @@ -437,6 +448,7 @@ EXPORT {
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_OVAL_BOXC)();
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_PLASTIC_UP_BOXC)();
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_GTK_UP_BOXC)();
FL_EXPORT_C(Fl_Boxtype, fl_define_FL_GLEAM_UP_BOXC)();
FL_EXPORT_C(Fl_Boxtype, fl_boxC)(Fl_Boxtype b) ;
FL_EXPORT_C(Fl_Boxtype, fl_downC)(Fl_Boxtype b) ;
FL_EXPORT_C(Fl_Boxtype, fl_frameC)(Fl_Boxtype b) ;
Expand Down
6 changes: 6 additions & 0 deletions c-src/Fl_GroupC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ EXPORT {
FL_EXPORT_C(void,Fl_Group_deactivate)(fl_Group win){
(static_cast<Fl_DerivedGroup*>(win))->deactivate();
}
FL_EXPORT_C(fl_Group,Fl_Group_current)(){
return (fl_Group)Fl_DerivedGroup::current();
}
FL_EXPORT_C(void , Fl_Group_set_current)(fl_Group g){
Fl_DerivedGroup::current(static_cast<Fl_DerivedGroup*>(g));
}
FL_EXPORT_C(unsigned int,Fl_Group_output)(fl_Group win){
return (static_cast<Fl_DerivedGroup*>(win))->output();
}
Expand Down
4 changes: 2 additions & 2 deletions c-src/Fl_GroupC.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ EXPORT {
FL_EXPORT_C(void, Fl_Group_resize)(fl_Group group,int X, int Y, int W, int H);

/* Fl_Group static members */
FL_EXPORT_C(fl_Group,Fl_Group_set_current)();
FL_EXPORT_C(void , Fl_Group_current)(fl_Group g);
FL_EXPORT_C(fl_Group,Fl_Group_current)();
FL_EXPORT_C(void , Fl_Group_set_current)(fl_Group g);

/* Fl_Group specific */
FL_EXPORT_C(void, Fl_Group_draw_child)(fl_Group group, fl_Widget widget);
Expand Down
2 changes: 1 addition & 1 deletion c-src/Fl_Menu_ButtonC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Fl_Menu_ButtonC.h"
#include "Utils.h"
#include "UtilsC.h"
#ifdef __cplusplus
EXPORT {
#endif
Expand Down
12 changes: 12 additions & 0 deletions c-src/Fl_Menu_ButtonC.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
#include "Fl_CallbackC.h"
#include "Fl_Menu_C.h"
EXPORT {
#endif
#ifndef INTERNAL_LINKAGE
typedef enum Menu_Button_Type {
NORMAL = 0,
POPUP1 = 1, /**< pops up with the mouse 1st button. */
POPUP2, /**< pops up with the mouse 2nd button. */
POPUP12, /**< pops up with the mouse 1st or 2nd buttons. */
POPUP3, /**< pops up with the mouse 3rd button. */
POPUP13, /**< pops up with the mouse 1st or 3rd buttons. */
POPUP23, /**< pops up with the mouse 2nd or 3rd buttons. */
POPUP123 /**< pops up with any mouse button. */
} Menu_Button_Type;
#endif
/* Inherited from Fl_Widget */
FL_EXPORT_C(int, Fl_Menu_Button_handle)(fl_Group self, int event);
Expand Down
Loading

0 comments on commit 88e79db

Please sign in to comment.