mirror of
https://github.com/fltk/fltk.git
synced 2026-06-07 17:35:39 +08:00
Fixed a bunch of warnings from gcc 4.4.5 . Most of these are parenthesis missing to make the precedence of && over || obvious. Ah well, why not...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+1
-1
@@ -986,7 +986,7 @@ int Fl::handle(int e, Fl_Window* window)
|
||||
switch (e) {
|
||||
|
||||
case FL_CLOSE:
|
||||
if (grab() || modal() && window != modal()) return 0;
|
||||
if ( grab() || (modal() && window != modal()) ) return 0;
|
||||
wi->do_callback();
|
||||
return 1;
|
||||
|
||||
|
||||
+6
-3
@@ -375,6 +375,7 @@ int Fl_Browser::item_height(void *item) const {
|
||||
if (hh > hmax) hmax = hh;
|
||||
} else {
|
||||
const int* i = column_widths();
|
||||
long int dummy;
|
||||
// do each column separately as they may all set different fonts:
|
||||
for (char* str = l->txt; str && *str; str++) {
|
||||
Fl_Font font = textfont(); // default font
|
||||
@@ -389,7 +390,7 @@ int Fl_Browser::item_height(void *item) const {
|
||||
case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
|
||||
case 'f': case 't': font = FL_COURIER; break;
|
||||
case 'B':
|
||||
case 'C': strtol(str, &str, 10); break;// skip a color number
|
||||
case 'C': dummy = strtol(str, &str, 10); break;// skip a color number
|
||||
case 'F': font = (Fl_Font)strtol(str,&str,10); break;
|
||||
case 'S': tsize = strtol(str,&str,10); break;
|
||||
case 0: case '@': str--;
|
||||
@@ -442,6 +443,7 @@ int Fl_Browser::item_width(void *item) const {
|
||||
int done = 0;
|
||||
|
||||
while (*str == format_char_ && str[1] && str[1] != format_char_) {
|
||||
long int dummy;
|
||||
str ++;
|
||||
switch (*str++) {
|
||||
case 'l': case 'L': tsize = 24; break;
|
||||
@@ -451,7 +453,7 @@ int Fl_Browser::item_width(void *item) const {
|
||||
case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
|
||||
case 'f': case 't': font = FL_COURIER; break;
|
||||
case 'B':
|
||||
case 'C': strtol(str, &str, 10); break;// skip a color number
|
||||
case 'C': dummy = strtol(str, &str, 10); break;// skip a color number
|
||||
case 'F': font = (Fl_Font)strtol(str, &str, 10); break;
|
||||
case 'S': tsize = strtol(str, &str, 10); break;
|
||||
case '.':
|
||||
@@ -536,6 +538,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
//#warning FIXME This maybe needs to be more UTF8 aware now...?
|
||||
//#endif /*__GNUC__*/
|
||||
while (*str == format_char() && *++str && *str != format_char()) {
|
||||
long int dummy;
|
||||
switch (*str++) {
|
||||
case 'l': case 'L': tsize = 24; break;
|
||||
case 'm': case 'M': tsize = 18; break;
|
||||
@@ -549,7 +552,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
if (!(l->flags & SELECTED)) {
|
||||
fl_color((Fl_Color)strtol(str, &str, 10));
|
||||
fl_rectf(X, Y, w1, H);
|
||||
} else strtol(str, &str, 10);
|
||||
} else dummy = strtol(str, &str, 10);
|
||||
break;
|
||||
case 'C':
|
||||
lcol = (Fl_Color)strtol(str, &str, 10);
|
||||
|
||||
@@ -3201,7 +3201,7 @@ Fl_Help_View::load(const char *f)// I - Filename to load (may also have target)
|
||||
rewind(fp);
|
||||
|
||||
value_ = (const char *)calloc(len + 1, 1);
|
||||
fread((void *)value_, 1, len, fp);
|
||||
if (fread((void *)value_, 1, len, fp)==0) { /* use default 0 */ }
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
|
||||
+6
-6
@@ -123,12 +123,12 @@ int Fl_Input::handle_key() {
|
||||
// find the insert position
|
||||
int ip = position()<mark() ? position() : mark();
|
||||
// This is complex to allow "0xff12" hex to be typed:
|
||||
if (!ip && (ascii == '+' || ascii == '-')
|
||||
if ( (!ip && (ascii == '+' || ascii == '-'))
|
||||
|| (ascii >= '0' && ascii <= '9')
|
||||
|| (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X'))
|
||||
|| (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X')
|
||||
&& (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f'))
|
||||
|| input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii))
|
||||
|| (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X')
|
||||
&& ((ascii>='A'&& ascii<='F') || (ascii>='a'&& ascii<='f')))
|
||||
|| (input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)))
|
||||
{
|
||||
if (readonly()) fl_beep();
|
||||
else replace(position(), mark(), &ascii, 1);
|
||||
@@ -532,8 +532,8 @@ int Fl_Input::handle(int event) {
|
||||
newpos = position();
|
||||
position( oldpos, oldmark );
|
||||
if (Fl::focus()==this && !Fl::event_state(FL_SHIFT) && input_type()!=FL_SECRET_INPUT &&
|
||||
(newpos >= mark() && newpos < position() ||
|
||||
newpos >= position() && newpos < mark())) {
|
||||
( (newpos >= mark() && newpos < position())
|
||||
|| (newpos >= position() && newpos < mark())) ) {
|
||||
// user clicked in the selection, may be trying to drag
|
||||
drag_start = newpos;
|
||||
return 1;
|
||||
|
||||
+1
-1
@@ -844,7 +844,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
|
||||
*/
|
||||
int Fl_Input_::undo() {
|
||||
was_up_down = 0;
|
||||
if (undowidget != this || !undocut && !undoinsert) return 0;
|
||||
if ( undowidget != this || (!undocut && !undoinsert) ) return 0;
|
||||
|
||||
int ilen = undocut;
|
||||
int xlen = undoinsert;
|
||||
|
||||
+4
-3
@@ -686,7 +686,7 @@ int menuwindow::early_hide_handle(int e) {
|
||||
}
|
||||
return 1;
|
||||
case FL_Right:
|
||||
if (pp.menubar && (pp.menu_number<=0 || pp.menu_number==1 && pp.nummenus==2))
|
||||
if (pp.menubar && (pp.menu_number<=0 || (pp.menu_number==1 && pp.nummenus==2)))
|
||||
forward(0);
|
||||
else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1);
|
||||
return 1;
|
||||
@@ -774,8 +774,9 @@ int menuwindow::early_hide_handle(int e) {
|
||||
case FL_RELEASE:
|
||||
// Mouse must either be held down/dragged some, or this must be
|
||||
// the second click (not the one that popped up the menu):
|
||||
if (!Fl::event_is_click() || pp.state == PUSH_STATE ||
|
||||
pp.menubar && pp.current_item && !pp.current_item->submenu() // button
|
||||
if ( !Fl::event_is_click()
|
||||
|| pp.state == PUSH_STATE
|
||||
|| (pp.menubar && pp.current_item && !pp.current_item->submenu()) // button
|
||||
) {
|
||||
#if 0 // makes the check/radio items leave the menu up
|
||||
const Fl_Menu_Item* m = pp.current_item;
|
||||
|
||||
+11
-8
@@ -162,9 +162,7 @@ const char *Fl_Preferences::newUUID()
|
||||
b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]);
|
||||
}
|
||||
#else
|
||||
# if defined(__GNUC__)
|
||||
# warning Unix implementation of Fl_Preferences::newUUID() incomplete!
|
||||
# endif /*__GNUC__*/
|
||||
// warning Unix implementation of Fl_Preferences::newUUID() incomplete!
|
||||
// #include <uuid/uuid.h>
|
||||
// void uuid_generate(uuid_t out);
|
||||
unsigned char b[16];
|
||||
@@ -692,8 +690,13 @@ static char *decodeText( const char *src )
|
||||
const char *s = src;
|
||||
for ( ; *s; s++, len++ )
|
||||
{
|
||||
if ( *s == '\\' )
|
||||
if ( isdigit( s[1] ) ) s+=3; else s+=1;
|
||||
if ( *s == '\\' ) {
|
||||
if ( isdigit( s[1] ) ) {
|
||||
s+=3;
|
||||
} else {
|
||||
s+=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
char *dst = (char*)malloc( len+1 ), *d = dst;
|
||||
for ( s = src; *s; s++ )
|
||||
@@ -1267,9 +1270,9 @@ int Fl_Preferences::RootNode::read()
|
||||
if ( !f )
|
||||
return -1;
|
||||
|
||||
fgets( buf, 1024, f );
|
||||
fgets( buf, 1024, f );
|
||||
fgets( buf, 1024, f );
|
||||
if (fgets( buf, 1024, f )==0) { /* ignore */ }
|
||||
if (fgets( buf, 1024, f )==0) { /* ignore */ }
|
||||
if (fgets( buf, 1024, f )==0) { /* ignore */ }
|
||||
Node *nd = prefs_->node;
|
||||
for (;;)
|
||||
{
|
||||
|
||||
+3
-3
@@ -348,9 +348,9 @@ void Fl_Scroll::resize(int X, int Y, int W, int H) {
|
||||
o->position(o->x()+dx, o->y()+dy);
|
||||
}
|
||||
if (dw==0 && dh==0) {
|
||||
char pad = (scrollbar.visible() && hscrollbar.visible());
|
||||
char al = (scrollbar.align()&FL_ALIGN_LEFT!=0);
|
||||
char at = (scrollbar.align()&FL_ALIGN_TOP!=0);
|
||||
char pad = ( scrollbar.visible() && hscrollbar.visible() );
|
||||
char al = ( (scrollbar.align() & FL_ALIGN_LEFT) != 0 );
|
||||
char at = ( (scrollbar.align() & FL_ALIGN_TOP) !=0 );
|
||||
scrollbar.position(al?X:X+W-scrollbar.w(), (at&&pad)?Y+hscrollbar.h():Y);
|
||||
hscrollbar.position((al&&pad)?X+scrollbar.w():X, at?Y:Y+H-hscrollbar.h());
|
||||
} else {
|
||||
|
||||
@@ -228,7 +228,7 @@ void Fl_Shared_Image::reload() {
|
||||
if (!name_) return;
|
||||
|
||||
if ((fp = fl_fopen(name_, "rb")) != NULL) {
|
||||
fread(header, 1, sizeof(header), fp);
|
||||
if (fread(header, 1, sizeof(header), fp)==0) { /* ignore */ }
|
||||
fclose(fp);
|
||||
} else {
|
||||
return;
|
||||
|
||||
+1
-1
@@ -246,7 +246,7 @@ int Fl_Tabs::handle(int event) {
|
||||
|
||||
int Fl_Tabs::push(Fl_Widget *o) {
|
||||
if (push_ == o) return 0;
|
||||
if (push_ && !push_->visible() || o && !o->visible())
|
||||
if ( (push_ && !push_->visible()) || (o && !o->visible()) )
|
||||
redraw_tabs();
|
||||
push_ = o;
|
||||
return 1;
|
||||
|
||||
@@ -414,7 +414,7 @@ void Fl_Text_Buffer::copy(Fl_Text_Buffer * fromBuf, int fromStart,
|
||||
|
||||
int Fl_Text_Buffer::undo(int *cursorPos)
|
||||
{
|
||||
if (undowidget != this || !undocut && !undoinsert && !mCanUndo)
|
||||
if (undowidget != this || (!undocut && !undoinsert && !mCanUndo) )
|
||||
return 0;
|
||||
|
||||
int ilen = undocut;
|
||||
|
||||
+4
-4
@@ -52,17 +52,17 @@ void Fl_Tile::position(int oix, int oiy, int newx, int newy) {
|
||||
int R = X+o->w();
|
||||
if (oix) {
|
||||
int t = p[0];
|
||||
if (t == oix || t>oix && X<newx || t<oix && X>newx) X = newx;
|
||||
if (t == oix || (t>oix && X<newx) || (t<oix && X>newx) ) X = newx;
|
||||
t = p[1];
|
||||
if (t == oix || t>oix && R<newx || t<oix && R>newx) R = newx;
|
||||
if (t == oix || (t>oix && R<newx) || (t<oix && R>newx) ) R = newx;
|
||||
}
|
||||
int Y = o->y();
|
||||
int B = Y+o->h();
|
||||
if (oiy) {
|
||||
int t = p[2];
|
||||
if (t == oiy || t>oiy && Y<newy || t<oiy && Y>newy) Y = newy;
|
||||
if (t == oiy || (t>oiy && Y<newy) || (t<oiy && Y>newy) ) Y = newy;
|
||||
t = p[3];
|
||||
if (t == oiy || t>oiy && B<newy || t<oiy && B>newy) B = newy;
|
||||
if (t == oiy || (t>oiy && B<newy) || (t<oiy && B>newy) ) B = newy;
|
||||
}
|
||||
o->damage_resize(X,Y,R-X,B-Y);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
|
||||
if (*q == '\\') switch (*++q) {
|
||||
case '\r':
|
||||
case '\n':
|
||||
fgets(q,(buffer+MAXSIZE+20)-q,f); break;
|
||||
if (!fgets(q,(buffer+MAXSIZE+20)-q,f)) { /* no problem if we hit EOF */ } break;
|
||||
case 0:
|
||||
break;
|
||||
case 'x': {
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ int Fl::compose(int& del) {
|
||||
char c1 = char(compose_state); // retrieve first character
|
||||
// now search for the pair in either order:
|
||||
for (const char *p = compose_pairs; *p; p += 2) {
|
||||
if (p[0] == ascii && p[1] == c1 || p[1] == ascii && p[0] == c1) {
|
||||
if ( (p[0] == ascii && p[1] == c1) || (p[1] == ascii && p[0] == c1)) {
|
||||
int len = fl_utf8encode((p-compose_pairs)/2+0xA0, e_text);
|
||||
e_text[len] = '\0';
|
||||
e_length = len;
|
||||
|
||||
+7
-3
@@ -304,7 +304,7 @@ static void unlock_function_rec() {
|
||||
# endif // PTHREAD_MUTEX_RECURSIVE
|
||||
|
||||
void Fl::awake(void* msg) {
|
||||
write(thread_filedes[1], &msg, sizeof(void*));
|
||||
if (write(thread_filedes[1], &msg, sizeof(void*))==0) { /* ignore */ }
|
||||
}
|
||||
|
||||
static void* thread_message_;
|
||||
@@ -315,7 +315,9 @@ void* Fl::thread_message() {
|
||||
}
|
||||
|
||||
static void thread_awake_cb(int fd, void*) {
|
||||
read(fd, &thread_message_, sizeof(void*));
|
||||
if (read(fd, &thread_message_, sizeof(void*))==0) {
|
||||
/* This should never happen */
|
||||
}
|
||||
Fl_Awake_Handler func;
|
||||
void *data;
|
||||
while (Fl::get_awake_handler_(func, data)==0) {
|
||||
@@ -331,7 +333,9 @@ void Fl::lock() {
|
||||
if (!thread_filedes[1]) {
|
||||
// Initialize thread communication pipe to let threads awake FLTK
|
||||
// from Fl::wait()
|
||||
pipe(thread_filedes);
|
||||
if (pipe(thread_filedes)==-1) {
|
||||
/* this should not happen */
|
||||
}
|
||||
|
||||
// Make the write side of the pipe non-blocking to avoid deadlock
|
||||
// conditions (STR #1537)
|
||||
|
||||
+7
-7
@@ -350,19 +350,19 @@ void fl_new_ic()
|
||||
#if USE_XFT
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#warning XFT support here
|
||||
// FIXME: warning XFT support here
|
||||
#endif /*__GNUC__*/
|
||||
|
||||
if (!fs) {
|
||||
fnt = NULL;//fl_get_font_xfld(0, 14);
|
||||
if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;}
|
||||
if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
|
||||
fs = XCreateFontSet(fl_display, fnt, &missing_list,
|
||||
&missing_count, &def_string);
|
||||
}
|
||||
#else
|
||||
if (!fs) {
|
||||
fnt = fl_get_font_xfld(0, 14);
|
||||
if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;}
|
||||
if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
|
||||
fs = XCreateFontSet(fl_display, fnt, &missing_list,
|
||||
&missing_count, &def_string);
|
||||
}
|
||||
@@ -465,16 +465,16 @@ void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win)
|
||||
#if USE_XFT
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#warning XFT support here
|
||||
// FIXME: warning XFT support here
|
||||
#endif /*__GNUC__*/
|
||||
|
||||
fnt = NULL; // fl_get_font_xfld(font, size);
|
||||
if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;}
|
||||
if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
|
||||
fs = XCreateFontSet(fl_display, fnt, &missing_list,
|
||||
&missing_count, &def_string);
|
||||
#else
|
||||
fnt = fl_get_font_xfld(font, size);
|
||||
if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;}
|
||||
if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
|
||||
fs = XCreateFontSet(fl_display, fnt, &missing_list,
|
||||
&missing_count, &def_string);
|
||||
#endif
|
||||
@@ -1725,7 +1725,7 @@ void Fl_Window::label(const char *name,const char *iname) {
|
||||
// contents are restored to the area, but this assumes the area
|
||||
// is cleared to background color. So this is disabled in this version.
|
||||
// Fl_Window *fl_boxcheat;
|
||||
static inline int can_boxcheat(uchar b) {return (b==1 || (b&2) && b<=15);}
|
||||
static inline int can_boxcheat(uchar b) {return (b==1 || ((b&2) && b<=15));}
|
||||
|
||||
void Fl_Window::show() {
|
||||
image(Fl::scheme_bg_);
|
||||
|
||||
+8
-8
@@ -81,19 +81,19 @@ void fl_frame(const char* s, int x, int y, int w, int h) {
|
||||
uchar *g = fl_gray_ramp();
|
||||
if (h > 0 && w > 0) for (;*s;) {
|
||||
// draw top line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_xyline(x, y, x+w-1);
|
||||
y++; if (--h <= 0) break;
|
||||
// draw left line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_yxline(x, y+h-1, y);
|
||||
x++; if (--w <= 0) break;
|
||||
// draw bottom line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_xyline(x, y+h-1, x+w-1);
|
||||
if (--h <= 0) break;
|
||||
// draw right line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_yxline(x+w-1, y+h-1, y);
|
||||
if (--w <= 0) break;
|
||||
}
|
||||
@@ -115,19 +115,19 @@ void fl_frame2(const char* s, int x, int y, int w, int h) {
|
||||
uchar *g = fl_gray_ramp();
|
||||
if (h > 0 && w > 0) for (;*s;) {
|
||||
// draw bottom line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_xyline(x, y+h-1, x+w-1);
|
||||
if (--h <= 0) break;
|
||||
// draw right line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_yxline(x+w-1, y+h-1, y);
|
||||
if (--w <= 0) break;
|
||||
// draw top line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_xyline(x, y, x+w-1);
|
||||
y++; if (--h <= 0) break;
|
||||
// draw left line:
|
||||
fl_color(g[*s++]);
|
||||
fl_color(g[(int)*s++]);
|
||||
fl_yxline(x, y+h-1, y);
|
||||
x++; if (--w <= 0) break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ static inline uchar realcolor(uchar color, uchar mask) {
|
||||
}
|
||||
return result;
|
||||
# else
|
||||
return (color&mask) | (~mask)&(mask>>1);
|
||||
return (color&mask) | ( (~mask)&(mask>>1) );
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ int fl_measure_pixmap(/*const*/ char* const* data, int &w, int &h) {
|
||||
int fl_measure_pixmap(const char * const *cdata, int &w, int &h) {
|
||||
int i = sscanf(cdata[0],"%d%d%d%d",&w,&h,&ncolors,&chars_per_pixel);
|
||||
if (i<4 || w<=0 || h<=0 ||
|
||||
chars_per_pixel!=1 && chars_per_pixel!=2) return w=0;
|
||||
(chars_per_pixel!=1 && chars_per_pixel!=2) ) return w=0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -587,7 +587,7 @@ static void fl_drawUCS4(const FcChar32 *str, int n, int x, int y) {
|
||||
void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#warning Need to improve this XFT right to left draw function
|
||||
// FIXME: warning Need to improve this XFT right to left draw function
|
||||
#endif /*__GNUC__*/
|
||||
|
||||
// This actually draws LtoR, but aligned to R edge with the glyph order reversed...
|
||||
|
||||
+30
-30
@@ -87,13 +87,13 @@ static void frame_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
{
|
||||
// Draw lines around the perimeter of the button, 4 colors per
|
||||
// circuit.
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_line(x, y + h + b, x + w - 1, y + h + b, x + w + b - 1, y + h);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_line(x + w + b - 1, y + h, x + w + b - 1, y, x + w - 1, y - b);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_line(x + w - 1, y - b, x, y - b, x - b, y);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_line(x - b, y, x - b, y + h, x, y + h + b);
|
||||
}
|
||||
}
|
||||
@@ -106,45 +106,45 @@ static void frame_round(int x, int y, int w, int h, const char *c, Fl_Color bc)
|
||||
if (w==h) {
|
||||
for (; b > 1; b --, x ++, y ++, w -= 2, h -= 2)
|
||||
{
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, h, 45.0, 135.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, h, 315.0, 405.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, h, 225.0, 315.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, h, 135.0, 225.0);
|
||||
}
|
||||
} else if (w>h) {
|
||||
int d = h/2;
|
||||
for (; b > 1; d--, b --, x ++, y ++, w -= 2, h -= 2)
|
||||
{
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, h, h, 90.0, 135.0);
|
||||
fl_xyline(x+d, y, x+w-d);
|
||||
fl_arc(x+w-h, y, h, h, 45.0, 90.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x+w-h, y, h, h, 315.0, 405.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x+w-h, y, h, h, 270.0, 315.0);
|
||||
fl_xyline(x+d, y+h-1, x+w-d);
|
||||
fl_arc(x, y, h, h, 225.0, 270.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, h, h, 135.0, 225.0);
|
||||
}
|
||||
} else if (w<h) {
|
||||
int d = w/2;
|
||||
for (; b > 1; d--, b --, x ++, y ++, w -= 2, h -= 2)
|
||||
{
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, w, 45.0, 135.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y, w, w, 0.0, 45.0);
|
||||
fl_yxline(x+w-1, y+d, y+h-d);
|
||||
fl_arc(x, y+h-w, w, w, 315.0, 360.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y+h-w, w, w, 225.0, 315.0);
|
||||
fl_color(shade_color(g[*c++], bc));
|
||||
fl_color(shade_color(g[(int)*c++], bc));
|
||||
fl_arc(x, y+h-w, w, w, 180.0, 225.0);
|
||||
fl_yxline(x, y+d, y+h-d);
|
||||
fl_arc(x, y, w, w, 135.0, 180.0);
|
||||
@@ -166,7 +166,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
|
||||
for (i = 0, j = 0; j < chalf; i ++, j += cstep) {
|
||||
// Draw the top line and points...
|
||||
fl_color(shade_color(g[c[i]], bc));
|
||||
fl_color(shade_color(g[(int)c[i]], bc));
|
||||
fl_xyline(x + 1, y + i, x + w - 2);
|
||||
|
||||
fl_color(shade_color(g[c[i] - 2], bc));
|
||||
@@ -174,7 +174,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
fl_point(x + w - 1, y + i + 1);
|
||||
|
||||
// Draw the bottom line and points...
|
||||
fl_color(shade_color(g[c[clen - i]], bc));
|
||||
fl_color(shade_color(g[(int)c[clen - i]], bc));
|
||||
fl_xyline(x + 1, y + h - i, x + w - 2);
|
||||
|
||||
fl_color(shade_color(g[c[clen - i] - 2], bc));
|
||||
@@ -185,7 +185,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
// Draw the interior and sides...
|
||||
i = chalf / cstep;
|
||||
|
||||
fl_color(shade_color(g[c[chalf]], bc));
|
||||
fl_color(shade_color(g[(int)c[chalf]], bc));
|
||||
fl_rectf(x + 1, y + i, w - 2, h - 2 * i + 1);
|
||||
|
||||
fl_color(shade_color(g[c[chalf] - 2], bc));
|
||||
@@ -197,7 +197,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
|
||||
for (i = 0, j = 0; j < chalf; i ++, j += cstep) {
|
||||
// Draw the left line and points...
|
||||
fl_color(shade_color(g[c[i]], bc));
|
||||
fl_color(shade_color(g[(int)c[i]], bc));
|
||||
fl_yxline(x + i, y + 1, y + h - 1);
|
||||
|
||||
fl_color(shade_color(g[c[i] - 2], bc));
|
||||
@@ -205,7 +205,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
fl_point(x + i + 1, y + h);
|
||||
|
||||
// Draw the right line and points...
|
||||
fl_color(shade_color(g[c[clen - i]], bc));
|
||||
fl_color(shade_color(g[(int)c[clen - i]], bc));
|
||||
fl_yxline(x + w - 1 - i, y + 1, y + h - 1);
|
||||
|
||||
fl_color(shade_color(g[c[clen - i] - 2], bc));
|
||||
@@ -216,7 +216,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
|
||||
// Draw the interior, top, and bottom...
|
||||
i = chalf / cstep;
|
||||
|
||||
fl_color(shade_color(g[c[chalf]], bc));
|
||||
fl_color(shade_color(g[(int)c[chalf]], bc));
|
||||
fl_rectf(x + i, y + 1, w - 2 * i, h - 1);
|
||||
|
||||
fl_color(shade_color(g[c[chalf] - 2], bc));
|
||||
@@ -236,20 +236,20 @@ static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc)
|
||||
const int na = 8;
|
||||
for (i=0; i<chalf; i++, d--, x++, y++, w-=2, h-=2)
|
||||
{
|
||||
fl_color(shade_color(g[c[i]], bc));
|
||||
fl_color(shade_color(g[(int)c[i]], bc));
|
||||
fl_pie(x, y, h, h, 90.0, 135.0+i*na);
|
||||
fl_xyline(x+d, y, x+w-d);
|
||||
fl_pie(x+w-h, y, h, h, 45.0+i*na, 90.0);
|
||||
fl_color(shade_color(g[c[i] - 2], bc));
|
||||
fl_color(shade_color(g[(int)c[i] - 2], bc));
|
||||
fl_pie(x+w-h, y, h, h, 315.0+i*na, 405.0+i*na);
|
||||
fl_color(shade_color(g[c[clen - i]], bc));
|
||||
fl_color(shade_color(g[(int)c[clen - i]], bc));
|
||||
fl_pie(x+w-h, y, h, h, 270.0, 315.0+i*na);
|
||||
fl_xyline(x+d, y+h-1, x+w-d);
|
||||
fl_pie(x, y, h, h, 225.0+i*na, 270.0);
|
||||
fl_color(shade_color(g[c[clen - i] - 2], bc));
|
||||
fl_color(shade_color(g[c[(int)clen - i] - 2], bc));
|
||||
fl_pie(x, y, h, h, 135.0+i*na, 225.0+i*na);
|
||||
}
|
||||
fl_color(shade_color(g[c[chalf]], bc));
|
||||
fl_color(shade_color(g[(int)c[chalf]], bc));
|
||||
fl_rectf(x+d, y, w-h+1, h+1);
|
||||
fl_pie(x, y, h, h, 90.0, 270.0);
|
||||
fl_pie(x+w-h, y, h, h, 270.0, 90.0);
|
||||
@@ -258,20 +258,20 @@ static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc)
|
||||
const int na = 8;
|
||||
for (i=0; i<chalf; i++, d--, x++, y++, w-=2, h-=2)
|
||||
{
|
||||
fl_color(shade_color(g[c[i]], bc));
|
||||
fl_color(shade_color(g[(int)c[i]], bc));
|
||||
fl_pie(x, y, w, w, 45.0+i*na, 135.0+i*na);
|
||||
fl_color(shade_color(g[c[i] - 2], bc));
|
||||
fl_pie(x, y, w, w, 0.0, 45.0+i*na);
|
||||
fl_yxline(x+w-1, y+d, y+h-d);
|
||||
fl_pie(x, y+h-w, w, w, 315.0+i*na, 360.0);
|
||||
fl_color(shade_color(g[c[clen - i]], bc));
|
||||
fl_color(shade_color(g[(int)c[clen - i]], bc));
|
||||
fl_pie(x, y+h-w, w, w, 225.0+i*na, 315.0+i*na);
|
||||
fl_color(shade_color(g[c[clen - i] - 2], bc));
|
||||
fl_pie(x, y+h-w, w, w, 180.0, 225.0+i*na);
|
||||
fl_yxline(x, y+d, y+h-d);
|
||||
fl_pie(x, y, w, w, 135.0+i*na, 180.0);
|
||||
}
|
||||
fl_color(shade_color(g[c[chalf]], bc));
|
||||
fl_color(shade_color(g[(int)c[chalf]], bc));
|
||||
fl_rectf(x, y+d, w+1, h-w+1);
|
||||
fl_pie(x, y, w, w, 0.0, 180.0);
|
||||
fl_pie(x, y+h-w, w, w, 180.0, 360.0);
|
||||
|
||||
@@ -116,7 +116,7 @@ static void make_raw_name(char *raw, char *pretty)
|
||||
char *nm2 = strchr(pretty, ',');
|
||||
if(nm2) *nm2 = 0; // terminate name after first entry
|
||||
raw[0] = ' '; raw[1] = 0; // Default start of "raw name" text
|
||||
strncat(raw, pretty, LOCAL_RAW_NAME_MAX);
|
||||
strncat(raw, pretty, LOCAL_RAW_NAME_MAX-1);
|
||||
#endif
|
||||
// At this point, the name is "marked" as regular...
|
||||
if (style)
|
||||
|
||||
+1
-1
@@ -574,7 +574,7 @@ void print_update_status() {
|
||||
if (print_choice->value()) {
|
||||
snprintf(command, sizeof(command), "lpstat -p '%s'", printer);
|
||||
if ((lpstat = popen(command, "r")) != NULL) {
|
||||
fgets(status, sizeof(status), lpstat);
|
||||
if (fgets(status, sizeof(status), lpstat)==0) { /* ignore */ }
|
||||
pclose(lpstat);
|
||||
} else strcpy(status, "printer status unavailable");
|
||||
} else status[0] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user