Skip to content

Commit

Permalink
add maximize functions, format
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Nov 5, 2023
1 parent 241cf60 commit 0a598b8
Show file tree
Hide file tree
Showing 42 changed files with 2,563 additions and 2,271 deletions.
19 changes: 12 additions & 7 deletions include/cfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ int Fl_box_border_radius_max(void);

void Fl_set_box_border_radius_max(int R);

unsigned int Fl_get_rgb_color(unsigned char r, unsigned char g, unsigned char b);
unsigned int Fl_get_rgb_color(unsigned char r, unsigned char g,
unsigned char b);

void Fl_set_color(unsigned int c, unsigned char r, unsigned char g, unsigned char b);
void Fl_set_color(unsigned int c, unsigned char r, unsigned char g,
unsigned char b);

void Fl_set_color_with_alpha(unsigned int c, unsigned char r, unsigned char g, unsigned char b,
unsigned char a);
void Fl_set_color_with_alpha(unsigned int c, unsigned char r, unsigned char g,
unsigned char b, unsigned char a);

const char *Fl_get_font(int idx);

Expand Down Expand Up @@ -270,7 +272,8 @@ void Fl_screen_xywh(int *X, int *Y, int *W, int *H, int n);

void Fl_screen_xywh_at(int *X, int *Y, int *W, int *H, int mx, int my);

void Fl_screen_xywh_inside(int *X, int *Y, int *W, int *H, int mx, int my, int mw, int mh);
void Fl_screen_xywh_inside(int *X, int *Y, int *W, int *H, int mx, int my,
int mw, int mh);

void Fl_screen_xywh_mouse(int *X, int *Y, int *W, int *H);

Expand Down Expand Up @@ -312,7 +315,8 @@ unsigned int Fl_lighter(unsigned int c);

unsigned int Fl_darker(unsigned int c);

void Fl_set_box_type_cb(int, void (*cb)(int, int, int, int, unsigned int), int, int, int, int);
void Fl_set_box_type_cb(int, void (*cb)(int, int, int, int, unsigned int), int,
int, int, int);

int Fl_draw_box_active(void);

Expand Down Expand Up @@ -350,7 +354,8 @@ Fl_Widget *Fl_Widget_Tracker_widget(Fl_Widget_Tracker *t);

int Fl_Widget_Tracker_exists(Fl_Widget_Tracker *t);

void Fl_get_color_rgb(unsigned int col, unsigned char *r, unsigned char *g, unsigned char *b);
void Fl_get_color_rgb(unsigned int col, unsigned char *r, unsigned char *g,
unsigned char *b);

int Fl_callback_reason(void);

Expand Down
91 changes: 46 additions & 45 deletions include/cfl_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,50 @@
extern "C" {
#endif

#define BROWSER_DECLARE(widget) \
int widget##_value(widget *); \
void widget##_remove(widget *, int line); \
void widget##_add(widget *, const char *newtext); \
void widget##_insert(widget *, int line, const char *newtext); \
void widget##_move(widget *, int to, int from); \
void widget##_swap(widget *, int a, int b); \
void widget##_clear(widget *); \
int widget##_size(const widget *); \
int widget##_select(widget *, int line); \
int widget##_selected(const widget *, int line); \
const char *widget##_text(const widget *, int line); \
void widget##_set_text(widget *, int line, const char *newtext); \
void widget##_load_file(widget *, const char *file); \
int widget##_text_size(widget *); \
void widget##_set_text_size(widget *, int s); \
void widget##_set_icon(widget *, int line, void *icon); \
void *widget##_icon(const widget *, int line); \
void widget##_remove_icon(widget *, int line); \
void widget##_topline(widget *self, int line); \
int widget##_is_topline(widget *self); \
void widget##_bottomline(widget *self, int line); \
void widget##_middleline(widget *self, int line); \
char widget##_format_char(const widget *self); \
void widget##_set_format_char(widget *self, char c); \
char widget##_column_char(const widget *self); \
void widget##_set_column_char(widget *self, char c); \
const int *widget##_column_widths(const widget *self); \
void widget##_set_column_widths(widget *self, const int *arr); \
int widget##_displayed(const widget *self, int line); \
void widget##_make_visible(widget *self, int line); \
int widget##_position(const widget *self); \
void widget##_set_position(widget *self, int pos); \
int widget##_hposition(const widget *self); \
void widget##_set_hposition(widget *self, int); \
unsigned char widget##_has_scrollbar(const widget *self); \
void widget##_set_has_scrollbar(widget *self, unsigned char mode); \
int widget##_scrollbar_size(const widget *self); \
void widget##_set_scrollbar_size(widget *self, int newSize); \
void widget##_sort(widget *self); \
void *widget##_scrollbar(widget *self); \
void *widget##_hscrollbar(widget *self); \
void *widget##_data(const widget *self, int line); \
void widget##_set_data(widget *self, int line, void *data); \
#define BROWSER_DECLARE(widget) \
int widget##_value(widget *); \
void widget##_remove(widget *, int line); \
void widget##_add(widget *, const char *newtext); \
void widget##_insert(widget *, int line, const char *newtext); \
void widget##_move(widget *, int to, int from); \
void widget##_swap(widget *, int a, int b); \
void widget##_clear(widget *); \
int widget##_size(const widget *); \
int widget##_select(widget *, int line); \
int widget##_selected(const widget *, int line); \
const char *widget##_text(const widget *, int line); \
void widget##_set_text(widget *, int line, const char *newtext); \
void widget##_load_file(widget *, const char *file); \
int widget##_text_size(widget *); \
void widget##_set_text_size(widget *, int s); \
void widget##_set_icon(widget *, int line, void *icon); \
void *widget##_icon(const widget *, int line); \
void widget##_remove_icon(widget *, int line); \
void widget##_topline(widget *self, int line); \
int widget##_is_topline(widget *self); \
void widget##_bottomline(widget *self, int line); \
void widget##_middleline(widget *self, int line); \
char widget##_format_char(const widget *self); \
void widget##_set_format_char(widget *self, char c); \
char widget##_column_char(const widget *self); \
void widget##_set_column_char(widget *self, char c); \
const int *widget##_column_widths(const widget *self); \
void widget##_set_column_widths(widget *self, const int *arr); \
int widget##_displayed(const widget *self, int line); \
void widget##_make_visible(widget *self, int line); \
int widget##_position(const widget *self); \
void widget##_set_position(widget *self, int pos); \
int widget##_hposition(const widget *self); \
void widget##_set_hposition(widget *self, int); \
unsigned char widget##_has_scrollbar(const widget *self); \
void widget##_set_has_scrollbar(widget *self, unsigned char mode); \
int widget##_scrollbar_size(const widget *self); \
void widget##_set_scrollbar_size(widget *self, int newSize); \
void widget##_sort(widget *self); \
void *widget##_scrollbar(widget *self); \
void *widget##_hscrollbar(widget *self); \
void *widget##_data(const widget *self, int line); \
void widget##_set_data(widget *self, int line, void *data); \
void widget##_hide_line(widget *self, int line);

WIDGET_DECLARE(Fl_Browser)
Expand Down Expand Up @@ -123,7 +123,8 @@ const void *Fl_Check_Browser_scrollbar(const Fl_Check_Browser *self);

const void *Fl_Check_Browser_hscrollbar(const Fl_Check_Browser *self);

void Fl_Check_Browser_set_has_scrollbar(Fl_Check_Browser *self, unsigned char mode);
void Fl_Check_Browser_set_has_scrollbar(Fl_Check_Browser *self,
unsigned char mode);

int Fl_Check_Browser_scrollbar_size(const Fl_Check_Browser *self);

Expand Down
14 changes: 7 additions & 7 deletions include/cfl_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
extern "C" {
#endif

#define BUTTON_DECLARE(widget) \
int widget##_shortcut(const widget *self); \
void widget##_set_shortcut(widget *self, int shortcut); \
int widget##_clear(widget *self); \
int widget##_value(widget *self); \
void widget##_set_value(widget *self, int flag); \
void widget##_set_down_box(widget *self, int); \
#define BUTTON_DECLARE(widget) \
int widget##_shortcut(const widget *self); \
void widget##_set_shortcut(widget *self, int shortcut); \
int widget##_clear(widget *self); \
int widget##_value(widget *self); \
void widget##_set_value(widget *self, int flag); \
void widget##_set_down_box(widget *self, int); \
int widget##_down_box(const widget *self);

WIDGET_DECLARE(Fl_Button)
Expand Down
31 changes: 20 additions & 11 deletions include/cfl_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const char *Fl_Native_File_Chooser_filenames(Fl_Native_File_Chooser *, int);

int Fl_Native_File_Chooser_count(Fl_Native_File_Chooser *);

void Fl_Native_File_Chooser_set_directory(Fl_Native_File_Chooser *, const char *val);
void Fl_Native_File_Chooser_set_directory(Fl_Native_File_Chooser *,
const char *val);

const char *Fl_Native_File_Chooser_directory(Fl_Native_File_Chooser *);

Expand All @@ -27,21 +28,25 @@ void Fl_Native_File_Chooser_set_option(Fl_Native_File_Chooser *, int opt);

void Fl_Native_File_Chooser_set_type(Fl_Native_File_Chooser *, int typ);

void Fl_Native_File_Chooser_set_title(Fl_Native_File_Chooser *, const char *title);
void Fl_Native_File_Chooser_set_title(Fl_Native_File_Chooser *,
const char *title);

void Fl_Native_File_Chooser_set_filter(Fl_Native_File_Chooser *, const char *f);

void Fl_Native_File_Chooser_set_preset_file(Fl_Native_File_Chooser *, const char *f);
void Fl_Native_File_Chooser_set_preset_file(Fl_Native_File_Chooser *,
const char *f);

const char *Fl_Native_File_Chooser_errmsg(Fl_Native_File_Chooser *);

void Fl_message(int x, int y, const char *txt);

void Fl_alert(int x, int y, const char *txt);

int Fl_choice(int x, int y, const char *txt, const char *b0, const char *b1, const char *b2);
int Fl_choice(int x, int y, const char *txt, const char *b0, const char *b1,
const char *b2);

int Fl_choice_n(int x, int y, const char *txt, const char *b0, const char *b1, const char *b2);
int Fl_choice_n(int x, int y, const char *txt, const char *b0, const char *b1,
const char *b2);

const char *Fl_input(int x, int y, const char *txt, const char *deflt);

Expand All @@ -53,7 +58,8 @@ void Fl_alert2(const char *txt);

int Fl_choice2(const char *txt, const char *b0, const char *b1, const char *b2);

int Fl_choice2_n(const char *txt, const char *b0, const char *b1, const char *b2);
int Fl_choice2_n(const char *txt, const char *b0, const char *b1,
const char *b2);

const char *Fl_input2(const char *txt, const char *deflt);

Expand Down Expand Up @@ -97,7 +103,8 @@ void Fl_beep(int type);

typedef struct Fl_File_Chooser Fl_File_Chooser;

Fl_File_Chooser *Fl_File_Chooser_new(const char *d, const char *p, int t, const char *title);
Fl_File_Chooser *Fl_File_Chooser_new(const char *d, const char *p, int t,
const char *title);

void Fl_File_Chooser_delete(Fl_File_Chooser *self);

Expand All @@ -107,7 +114,8 @@ void *Fl_File_Chooser_previewButton(Fl_File_Chooser *self);

void *Fl_File_Chooser_showHiddenButton(Fl_File_Chooser *self);

void Fl_File_Chooser_set_callback(Fl_File_Chooser *self, void (*cb)(Fl_File_Chooser *, void *),
void Fl_File_Chooser_set_callback(Fl_File_Chooser *self,
void (*cb)(Fl_File_Chooser *, void *),
void *d);

void Fl_File_Chooser_set_color(Fl_File_Chooser *self, unsigned int c);
Expand Down Expand Up @@ -222,10 +230,11 @@ int Fl_File_Chooser_h(const Fl_File_Chooser *self);

char *Fl_dir_chooser(const char *message, const char *fname, int relative);

char *Fl_file_chooser(const char *message, const char *pat, const char *fname, int relative);
char *Fl_file_chooser(const char *message, const char *pat, const char *fname,
int relative);

int Fl_color_chooser(const char *name, unsigned char *r, unsigned char *g, unsigned char *b,
int cmode);
int Fl_color_chooser(const char *name, unsigned char *r, unsigned char *g,
unsigned char *b, int cmode);

void Fl_message_title(const char *title);

Expand Down
27 changes: 16 additions & 11 deletions include/cfl_draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void Fl_rectf(int x, int y, int w, int h);

void Fl_rectf_with_color(int x, int y, int w, int h, unsigned int c);

void Fl_rectf_with_rgb(int x, int y, int w, int h, unsigned char r, unsigned char g,
unsigned char b);
void Fl_rectf_with_rgb(int x, int y, int w, int h, unsigned char r,
unsigned char g, unsigned char b);

void Fl_line(int x, int y, int x1, int y1);

Expand Down Expand Up @@ -96,8 +96,8 @@ void Fl_begin_polygon(void);

void Fl_vertex(double x, double y);

void Fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3,
double Y3);
void Fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2,
double X3, double Y3);

void Fl_arc2(double x, double y, double r, double start, double end);

Expand Down Expand Up @@ -173,21 +173,25 @@ void Fl_rtl_draw(const char *str, int n, int x, int y);

void Fl_measure(const char *str, int *x, int *y, int draw_symbols);

void Fl_draw5(const char *str, int x, int y, int w, int h, int align, void **img, int draw_symbols);
void Fl_draw5(const char *str, int x, int y, int w, int h, int align,
void **img, int draw_symbols);

void Fl_frame(const char *s, int x, int y, int w, int h);

void Fl_frame2(const char *s, int x, int y, int w, int h);

void Fl_draw_box(int box_type, int x, int y, int w, int h, unsigned int);

void Fl_draw_image(const unsigned char *buf, int X, int Y, int W, int H, int D, int L);
void Fl_draw_image(const unsigned char *buf, int X, int Y, int W, int H, int D,
int L);

void Fl_draw_image_mono(const unsigned char *buf, int X, int Y, int W, int H, int D, int L);
void Fl_draw_image_mono(const unsigned char *buf, int X, int Y, int W, int H,
int D, int L);

char Fl_can_do_alpha_blending(void);

unsigned char *Fl_read_image(unsigned char *p, int X, int Y, int W, int H, int alpha);
unsigned char *Fl_read_image(unsigned char *p, int X, int Y, int W, int H,
int alpha);

unsigned char *Fl_capture_window_part(void *win, int x, int y, int w, int h);

Expand All @@ -213,8 +217,8 @@ void Fl_set_cursor(int cursor);

void Fl_set_cursor2(int cursor, int fg, int bg);

const char *Fl_expand_text(const char *from, char *buf, int maxbuf, double maxw, int *n,
double *width, int wrap, int draw_symbols);
const char *Fl_expand_text(const char *from, char *buf, int maxbuf, double maxw,
int *n, double *width, int wrap, int draw_symbols);

void Fl_set_status(int X, int Y, int W, int H);

Expand All @@ -224,7 +228,8 @@ void Fl_reset_spot(void);

unsigned int Fl_show_colormap(unsigned int old_col);

void Fl_copy_offscreen(int x, int y, int w, int h, void *pixmap, int srcx, int srcy);
void Fl_copy_offscreen(int x, int y, int w, int h, void *pixmap, int srcx,
int srcy);

void *Fl_create_offscreen(int w, int h);

Expand Down
13 changes: 8 additions & 5 deletions include/cfl_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ double Fl_Color_Chooser_g(Fl_Color_Chooser *self);

double Fl_Color_Chooser_b(Fl_Color_Chooser *self);

int Fl_Color_Chooser_set_rgb(Fl_Color_Chooser *self, double r, double g, double b);
int Fl_Color_Chooser_set_rgb(Fl_Color_Chooser *self, double r, double g,
double b);

GROUP_DECLARE(Fl_Color_Chooser)

Expand Down Expand Up @@ -119,14 +120,16 @@ void Fl_Grid_set_need_layout(Fl_Grid *self, int set);

int Fl_Grid_need_layout(const Fl_Grid *self);

void Fl_Grid_set_margin(Fl_Grid *self, int left, int top, int right, int bottom);
void Fl_Grid_set_margin(Fl_Grid *self, int left, int top, int right,
int bottom);

void Fl_Grid_set_gap(Fl_Grid *self, int row_gap, int col_gap);

void *Fl_Grid_set_widget(Fl_Grid *self, Fl_Widget *wi, int row, int col, unsigned short align);
void *Fl_Grid_set_widget(Fl_Grid *self, Fl_Widget *wi, int row, int col,
unsigned short align);

void *Fl_Grid_set_widget_ext(Fl_Grid *self, Fl_Widget *wi, int row, int col, int rowspan,
int colspan, unsigned short align);
void *Fl_Grid_set_widget_ext(Fl_Grid *self, Fl_Widget *wi, int row, int col,
int rowspan, int colspan, unsigned short align);

void Fl_Grid_set_col_width(Fl_Grid *self, int col, int value);

Expand Down
Loading

0 comments on commit 0a598b8

Please sign in to comment.