Skip to content

Commit 566f1e1

Browse files
committed
add contrast and menu funcs
1 parent af453ac commit 566f1e1

File tree

5 files changed

+68
-2
lines changed

5 files changed

+68
-2
lines changed

fltk

include/cfl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,16 @@ void Fl_set_option(int opt, int val);
388388

389389
void Fl_load_system_icons(void);
390390

391+
void Fl_set_contrast_level(int level);
392+
393+
int Fl_contrast_level();
394+
395+
void Fl_set_contrast_mode(int mode);
396+
397+
int Fl_contrast_mode();
398+
399+
void Fl_set_contrast_function(unsigned int (*f)(unsigned int, unsigned int, int, int));
400+
391401
#ifdef __cplusplus
392402
}
393403
#endif

include/cfl_menu.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ extern "C" {
5151
char *pathname, \
5252
int pathnamelen, \
5353
const Fl_Menu_Item *item \
54-
);
54+
); \
55+
void widget##_set_menu_box(widget *self, int b); \
56+
int widget##_menu_box(const widget *self);
5557

5658
typedef struct Fl_Menu_Item Fl_Menu_Item;
5759

@@ -95,6 +97,18 @@ void Fl_Menu_Item_delete(Fl_Menu_Item *self);
9597

9698
const Fl_Menu_Item *Fl_Menu_Item_popup(Fl_Menu_Item *self, int x, int y);
9799

100+
const Fl_Menu_Item *Fl_Menu_Item_pulldown(
101+
Fl_Menu_Item *self,
102+
int X,
103+
int Y,
104+
int W,
105+
int H,
106+
const Fl_Menu_Item *picked,
107+
const void *,
108+
const Fl_Menu_Item *title,
109+
int menubar
110+
);
111+
98112
const char *Fl_Menu_Item_label(Fl_Menu_Item *);
99113

100114
void Fl_Menu_Item_set_label(Fl_Menu_Item *, const char *a);

src/cfl.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,4 +851,24 @@ void Fl_set_option(int opt, int val) {
851851

852852
void Fl_load_system_icons(void) {
853853
Fl_File_Icon::load_system_icons();
854+
}
855+
856+
void Fl_set_contrast_level(int level) {
857+
fl_contrast_level(level);
858+
}
859+
860+
int Fl_contrast_level() {
861+
return fl_contrast_level();
862+
}
863+
864+
void Fl_set_contrast_mode(int mode) {
865+
fl_contrast_mode(mode);
866+
}
867+
868+
int Fl_contrast_mode() {
869+
return fl_contrast_mode();
870+
}
871+
872+
void Fl_set_contrast_function(unsigned int (*f)(unsigned int, unsigned int, int, int)) {
873+
fl_contrast_function(f);
854874
}

src/cfl_menu.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@
142142
LOCK(auto ret = self->item_pathname(temp, 256, item); \
143143
if (ret == 0) strncpy(pathname, temp, strlen(temp) + 1);); \
144144
return ret; \
145+
} \
146+
void widget##_set_menu_box(widget *self, int b) { \
147+
LOCK(self->menu_box((Fl_Boxtype)b)); \
148+
} \
149+
int widget##_menu_box(const widget *self) { \
150+
LOCK(auto ret = self->menu_box()); \
151+
return ret; \
145152
}
146153

147154
WIDGET_CLASS(Fl_Menu_Bar)
@@ -234,6 +241,21 @@ const Fl_Menu_Item *Fl_Menu_Item_popup(Fl_Menu_Item *self, int x, int y) {
234241
return ret;
235242
}
236243

244+
const Fl_Menu_Item *Fl_Menu_Item_pulldown(
245+
Fl_Menu_Item *self,
246+
int X,
247+
int Y,
248+
int W,
249+
int H,
250+
const Fl_Menu_Item *picked,
251+
const void *menu,
252+
const Fl_Menu_Item *title,
253+
int menubar
254+
) {
255+
LOCK(auto ret = self->pulldown(X, Y, W, H, picked, (const Fl_Menu_ *)menu, title, menubar));
256+
return ret;
257+
}
258+
237259
const char *Fl_Menu_Item_label(Fl_Menu_Item *self) {
238260
LOCK(auto ret = self->label());
239261
return ret;

0 commit comments

Comments
 (0)