Fri Mar 3 14:43:37 PST 2000

(KainX)

Added Jerome De Greef's E-Exec patch and fixed several warnings.


SVN revision: 2177
This commit is contained in:
Michael Jennings 2000-03-03 22:45:02 +00:00
parent ea366599a8
commit 3afb1042d3
6 changed files with 188 additions and 147 deletions

View File

@ -2000,3 +2000,9 @@ Mon Feb 28 19:50:20 GMT 2000
64-bit fixes from Bob Arendt <rdarendt@cwcom.net> 64-bit fixes from Bob Arendt <rdarendt@cwcom.net>
-------------------------------------------------------------------------------
Fri Mar 3 14:43:37 PST 2000
(KainX)
Added Jerome De Greef's E-Exec patch and fixed several warnings.

View File

@ -100,7 +100,7 @@ static Epplet_window Epplet_window_get_from_Window(Window win);
static Window Epplet_internal_create_window(int w, int h, static Window Epplet_internal_create_window(int w, int h,
char *title, char vertical, char *title, char vertical,
char decorate); char decorate);
static void remember_stuff(void *data); static void remember_stuff(void *data);
#define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_DECORATIONS (1L << 1)
typedef struct _mwmhints typedef struct _mwmhints
@ -545,8 +545,8 @@ Epplet_Init(char *name,
wmDeleteWindow = XInternAtom(disp, "WM_DELETE_WINDOW", False); wmDeleteWindow = XInternAtom(disp, "WM_DELETE_WINDOW", False);
Epplet_timer (remember_stuff, NULL, 10, "REMEMBER_TIMER"); Epplet_timer(remember_stuff, NULL, 10, "REMEMBER_TIMER");
sa.sa_handler = Epplet_handle_child; sa.sa_handler = Epplet_handle_child;
sa.sa_flags = SA_RESTART; sa.sa_flags = SA_RESTART;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
@ -882,12 +882,15 @@ Epplet_handle_delete_event(Window xwin)
} }
} }
static void remember_stuff(void *data) static void
remember_stuff(void *data)
{ {
if(need_remember) if (need_remember)
Epplet_remember(); Epplet_remember();
need_remember = 0; need_remember = 0;
Epplet_timer (remember_stuff, NULL, 10, "REMEMBER_TIMER"); Epplet_timer(remember_stuff, NULL, 10, "REMEMBER_TIMER");
return;
data = NULL;
} }
void void
@ -895,8 +898,8 @@ Epplet_cleanup(void)
{ {
char s[1024]; char s[1024];
if(need_remember) if (need_remember)
Epplet_remember(); Epplet_remember();
/* remove lock file */ /* remove lock file */
Esnprintf(s, sizeof(s), "%s/.lock_%i", conf_dir, epplet_instance); Esnprintf(s, sizeof(s), "%s/.lock_%i", conf_dir, epplet_instance);
@ -963,16 +966,18 @@ Epplet_show(void)
void void
Epplet_remember(void) Epplet_remember(void)
{ {
char s[1024]; char s[1024];
#ifdef NEW_REMEMBER #ifdef NEW_REMEMBER
#ifndef NO_AUTO_RESPAWN #ifndef NO_AUTO_RESPAWN
char commandbuf[] = "command"; char commandbuf[] = "command";
#else #else
char commandbuf[] = ""; char commandbuf[] = "";
#endif #endif
Esnprintf(s, sizeof(s), "remember %x none layer border location " Esnprintf(s, sizeof(s), "remember %x none layer border location "
"sticky shade group %s", (unsigned int)mainwin->win, commandbuf); "sticky shade group %s", (unsigned int)mainwin->win, commandbuf);
ECommsSend(s); ECommsSend(s);
#else #else
Esnprintf(s, sizeof(s), "remember %x none", (unsigned int)mainwin->win); Esnprintf(s, sizeof(s), "remember %x none", (unsigned int)mainwin->win);
@ -1324,13 +1329,13 @@ Epplet_handle_event(XEvent * ev)
(XPointer *) & g) == XCNOENT) (XPointer *) & g) == XCNOENT)
g = NULL; g = NULL;
if (g) if (g)
Epplet_event(g, ev); Epplet_event(g, ev);
else else
{ {
if (buttonpress_func) if (buttonpress_func)
(*buttonpress_func) (buttonpress_data, ev->xbutton.window, (*buttonpress_func) (buttonpress_data, ev->xbutton.window,
ev->xbutton.x, ev->xbutton.y, ev->xbutton.x, ev->xbutton.y,
ev->xbutton.button); ev->xbutton.button);
} }
break; break;
case ButtonRelease: case ButtonRelease:
@ -3907,7 +3912,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadButton *g; GadButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadButton *) gadget; g = (GadButton *) gadget;
g->clicked = 1; g->clicked = 1;
Epplet_draw_button(gadget); Epplet_draw_button(gadget);
@ -3918,16 +3923,16 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadHSlider *g; GadHSlider *g;
g = (GadHSlider *) gadget; g = (GadHSlider *) gadget;
if(ev->xbutton.button<4) if (ev->xbutton.button < 4)
g->clicked = 1; g->clicked = 1;
if (ev->xbutton.window == g->win) if (ev->xbutton.window == g->win)
{ {
if (ev->xbutton.button == 4) if (ev->xbutton.button == 4)
(*(g->val)) += g->jump; (*(g->val)) += g->jump;
else if (ev->xbutton.button == 5) else if (ev->xbutton.button == 5)
(*(g->val)) -= g->jump; (*(g->val)) -= g->jump;
else if (ev->xbutton.x > (((*(g->val)) * g->w) / else if (ev->xbutton.x > (((*(g->val)) * g->w) /
(g->max - g->min + 1))) (g->max - g->min + 1)))
(*(g->val)) += g->jump; (*(g->val)) += g->jump;
else else
(*(g->val)) -= g->jump; (*(g->val)) -= g->jump;
@ -3946,16 +3951,16 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadVSlider *g; GadVSlider *g;
g = (GadVSlider *) gadget; g = (GadVSlider *) gadget;
if(ev->xbutton.button<4) if (ev->xbutton.button < 4)
g->clicked = 1; g->clicked = 1;
if (ev->xbutton.window == g->win) if (ev->xbutton.window == g->win)
{ {
if (ev->xbutton.button == 4) if (ev->xbutton.button == 4)
(*(g->val)) -= g->jump; (*(g->val)) -= g->jump;
else if (ev->xbutton.button == 5) else if (ev->xbutton.button == 5)
(*(g->val)) += g->jump; (*(g->val)) += g->jump;
else if (ev->xbutton.y > (((*(g->val)) * g->h) / else if (ev->xbutton.y > (((*(g->val)) * g->h) /
(g->max - g->min + 1))) (g->max - g->min + 1)))
(*(g->val)) += g->jump; (*(g->val)) += g->jump;
else else
(*(g->val)) -= g->jump; (*(g->val)) -= g->jump;
@ -3974,7 +3979,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadToggleButton *g; GadToggleButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadToggleButton *) gadget; g = (GadToggleButton *) gadget;
g->clicked = 1; g->clicked = 1;
Epplet_draw_togglebutton(gadget); Epplet_draw_togglebutton(gadget);
@ -3985,7 +3990,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadPopupButton *g; GadPopupButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadPopupButton *) gadget; g = (GadPopupButton *) gadget;
g->clicked = 1; g->clicked = 1;
Epplet_draw_popupbutton(gadget); Epplet_draw_popupbutton(gadget);
@ -3995,71 +4000,71 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
break; break;
case E_TEXTBOX: case E_TEXTBOX:
{ {
GadTextBox *g; GadTextBox *g;
int tmp_x, tmp_y, width, length, index, int tmp_x, tmp_y, width, length, index, last_index,
last_index, text_w, text_h, text_wl, text_wr; text_w, text_h, text_wl, text_wr;
Window dummy; Window dummy;
char buf, left=1, right=1; char buf, left = 1, right = 1;
float delta; float delta;
g = (GadTextBox *) gadget; g = (GadTextBox *) gadget;
if (g->contents == NULL) if (g->contents == NULL)
break; break;
XTranslateCoordinates(disp, g->win, root, 0, 0, &tmp_x, &tmp_y, &dummy); XTranslateCoordinates(disp, g->win, root, 0, 0, &tmp_x, &tmp_y, &dummy);
width = rx - tmp_x; width = rx - tmp_x;
length = strlen(g->contents); length = strlen(g->contents);
index = last_index = length/2; index = last_index = length / 2;
delta = last_index/2; delta = last_index / 2;
while (delta >= 1.0) while (delta >= 1.0)
{ {
index = last_index; index = last_index;
buf = g->contents[index]; buf = g->contents[index];
g->contents[index] = 0; g->contents[index] = 0;
Epplet_textbox_textsize(g, &text_w, &text_h, g->contents); Epplet_textbox_textsize(g, &text_w, &text_h, g->contents);
g->contents[index] = buf; g->contents[index] = buf;
if (text_w <= width) if (text_w <= width)
last_index += rint(delta); last_index += rint(delta);
else else
last_index -= rint(delta); last_index -= rint(delta);
delta /= 2.0; delta /= 2.0;
} }
while (1) while (1)
{ {
if (left) if (left)
{ {
buf = g->contents[index-1]; buf = g->contents[index - 1];
g->contents[index-1] = 0; g->contents[index - 1] = 0;
Epplet_textbox_textsize(g, &text_wl, &text_h, g->contents); Epplet_textbox_textsize(g, &text_wl, &text_h, g->contents);
g->contents[index-1] = buf; g->contents[index - 1] = buf;
} }
if (right) if (right)
{ {
buf = g->contents[index+1]; buf = g->contents[index + 1];
g->contents[index+1] = 0; g->contents[index + 1] = 0;
Epplet_textbox_textsize(g, &text_wr, &text_h, g->contents); Epplet_textbox_textsize(g, &text_wr, &text_h, g->contents);
g->contents[index+1] = buf; g->contents[index + 1] = buf;
} }
if (abs(text_wl - width) < abs(text_w - width)) if (abs(text_wl - width) < abs(text_w - width))
{ {
right = 0; right = 0;
text_wr = text_w; text_wr = text_w;
text_w = text_wl; text_w = text_wl;
index--; index--;
} }
else if (abs(text_wr - width) < abs(text_w - width)) else if (abs(text_wr - width) < abs(text_w - width))
{ {
left = 0; left = 0;
text_wl = text_w; text_wl = text_w;
text_w = text_wr; text_w = text_wr;
index++; index++;
} }
else else
break; break;
} }
g->cursor_pos = index; g->cursor_pos = index;
Epplet_draw_textbox(g); Epplet_draw_textbox(g);
@ -4079,7 +4084,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadButton *g; GadButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadButton *) gadget; g = (GadButton *) gadget;
g->clicked = 0; g->clicked = 0;
Epplet_draw_button(gadget); Epplet_draw_button(gadget);
@ -4110,8 +4115,8 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadHSlider *g; GadHSlider *g;
g = (GadHSlider *) gadget; g = (GadHSlider *) gadget;
if(ev->xbutton.button<4) if (ev->xbutton.button < 4)
g->clicked = 0; g->clicked = 0;
Epplet_draw_hslider(gadget); Epplet_draw_hslider(gadget);
} }
break; break;
@ -4120,8 +4125,8 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadVSlider *g; GadVSlider *g;
g = (GadVSlider *) gadget; g = (GadVSlider *) gadget;
if(ev->xbutton.button<4) if (ev->xbutton.button < 4)
g->clicked = 0; g->clicked = 0;
Epplet_draw_vslider(gadget); Epplet_draw_vslider(gadget);
} }
break; break;
@ -4130,7 +4135,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadToggleButton *g; GadToggleButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadToggleButton *) gadget; g = (GadToggleButton *) gadget;
g->clicked = 0; g->clicked = 0;
if (g->hilited) if (g->hilited)
@ -4150,7 +4155,7 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
GadPopupButton *g; GadPopupButton *g;
if (ev->xbutton.button > 3) if (ev->xbutton.button > 3)
break; break;
g = (GadPopupButton *) gadget; g = (GadPopupButton *) gadget;
g->clicked = 0; g->clicked = 0;
if (g->popped) if (g->popped)
@ -5088,53 +5093,56 @@ Epplet_free_rgb_buf(RGB_buf buf)
#ifdef HAVE_LIBGL #ifdef HAVE_LIBGL
GLXContext GLXContext
Epplet_bind_double_GL(Epplet_gadget da, int red, int green, int blue, Epplet_bind_double_GL(Epplet_gadget da, int red, int green, int blue,
int aux_buffers, int alpha, int depth, int stencil, int accum_red, int aux_buffers, int alpha, int depth, int stencil, int accum_red,
int accum_green, int accum_blue, int accum_alpha) int accum_green, int accum_blue, int accum_alpha)
{ {
XVisualInfo *vi; XVisualInfo *vi;
GLXContext cx; GLXContext cx;
Window win; Window win;
/* This sets up our MINIMUM request list for glx values. If all
the following minimums are not available, then a NULL is
returned for cx. You also might get a LARGER value then you
specify. */
int attributeListDbl[]={GLX_RGBA, GLX_DOUBLEBUFFER, /* This sets up our MINIMUM request list for glx values. If all
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue, * the following minimums are not available, then a NULL is
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers, * returned for cx. You also might get a LARGER value then you
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil, * specify. */
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
None};
win = Epplet_get_drawingarea_window(da); int attributeListDbl[] =
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListDbl); {GLX_RGBA, GLX_DOUBLEBUFFER,
cx = glXCreateContext(disp, vi, 0, GL_TRUE); GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
glXMakeCurrent(disp, win, cx); GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
None};
return cx; win = Epplet_get_drawingarea_window(da);
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListDbl);
cx = glXCreateContext(disp, vi, 0, GL_TRUE);
glXMakeCurrent(disp, win, cx);
return cx;
} }
GLXContext GLXContext
Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue, Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
int aux_buffers, int alpha, int depth, int stencil, int accum_red, int aux_buffers, int alpha, int depth, int stencil, int accum_red,
int accum_green, int accum_blue, int accum_alpha) int accum_green, int accum_blue, int accum_alpha)
{ {
XVisualInfo *vi; XVisualInfo *vi;
GLXContext cx; GLXContext cx;
Window win; Window win;
int attributeListSgl[]={GLX_RGBA, int attributeListSgl[] =
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue, {GLX_RGBA,
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers, GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil, GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green, GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha, GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
None}; GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
None};
win = Epplet_get_drawingarea_window(da);
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListSgl); win = Epplet_get_drawingarea_window(da);
cx = glXCreateContext(disp, vi, 0, GL_TRUE); vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListSgl);
glXMakeCurrent(disp, win, cx); cx = glXCreateContext(disp, vi, 0, GL_TRUE);
glXMakeCurrent(disp, win, cx);
return cx; return cx;
} }
@ -5142,7 +5150,7 @@ Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
GLXContext GLXContext
Epplet_default_bind_GL(Epplet_gadget da) Epplet_default_bind_GL(Epplet_gadget da)
{ {
return Epplet_bind_double_GL(da, 1, 1, 1, 0, 0, 8, 0, 0, 0, 0, 0); return Epplet_bind_double_GL(da, 1, 1, 1, 0, 0, 8, 0, 0, 0, 0, 0);
} }
void void

View File

@ -40,9 +40,9 @@
#include "epplet.h" #include "epplet.h"
#include <errno.h> #include <errno.h>
#ifdef HAVE_STDARG_H #ifdef HAVE_STDARG_H
# include <stdarg.h> #include <stdarg.h>
#elif defined(HAVE_VARARGS_H) #elif defined(HAVE_VARARGS_H)
# include <varargs.h> #include <varargs.h>
#endif #endif
/* /*
@ -90,7 +90,7 @@ Evsnprintf(char *str, size_t count, const char *fmt, va_list args)
#ifdef HAVE_STDARG_H #ifdef HAVE_STDARG_H
int int
Esnprintf(char *str, size_t count, const char *fmt, ...) Esnprintf(char *str, size_t count, const char *fmt,...)
#else #else
int int
Esnprintf(va_alist) Esnprintf(va_alist)

View File

@ -349,6 +349,8 @@ toggle_nice(void *data)
sprintf(s, "%d", include_nice); sprintf(s, "%d", include_nice);
Epplet_modify_config("nice", s); Epplet_modify_config("nice", s);
Epplet_save_config(); Epplet_save_config();
return;
data = NULL;
} }
static int static int

View File

@ -1,10 +1,10 @@
#include "epplet.h" #include "epplet.h"
#define EPPLET_NAME "E-Exec" #define EPPLET_NAME "E-Exec"
#define EPPLET_VERSION "0.4" #define EPPLET_VERSION "0.5"
#define EPPLET_INFO "Exec a command given by the user" #define EPPLET_INFO "Exec a command given by the user"
#define MAX_HIST_LEN 15 #define MAX_HIST_LEN 20
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
@ -14,7 +14,7 @@ Epplet_gadget history_popup = NULL;
char *command_history[MAX_HIST_LEN]; char *command_history[MAX_HIST_LEN];
int current_command = 0; int current_command = 0;
int num_commands = 0; int num_commands = 0;
int save_history = TRUE, delete_history = FALSE; int save_history = TRUE, delete_history = FALSE, auto_run = FALSE;
Window config_win = None; Window config_win = None;
static void cb_close(void *data); static void cb_close(void *data);
@ -24,6 +24,7 @@ static void hist_last(void *data);
static void hist_next(void *data); static void hist_next(void *data);
static void empty_popup(void); static void empty_popup(void);
static void fill_popup(void); static void fill_popup(void);
static void exec_popup(void *data);
static void cb_ok(void *data); static void cb_ok(void *data);
static void cb_cancel(void *data); static void cb_cancel(void *data);
static void cb_configure(void *data); static void cb_configure(void *data);
@ -42,8 +43,7 @@ run_contents(void *data)
{ {
char *command = Epplet_textbox_contents(textbox); char *command = Epplet_textbox_contents(textbox);
int i; int i;
int command_exists, num_results; int command_exists;
char **results;
if (!Epplet_popup_entry_get_data(history_popup, 0)) if (!Epplet_popup_entry_get_data(history_popup, 0))
Epplet_remove_popup_entry(history_popup, 0); Epplet_remove_popup_entry(history_popup, 0);
@ -97,6 +97,22 @@ change_textbox(void *data)
Epplet_change_textbox(textbox, s); Epplet_change_textbox(textbox, s);
} }
static void
exec_popup(void *data)
{
char *command = (char *)data;
if (auto_run)
{
Epplet_spawn_command(command);
}
else
{
change_textbox(command);
}
return;
data = NULL;
}
static void static void
hist_last(void *data) hist_last(void *data)
{ {
@ -155,7 +171,7 @@ empty_popup(void)
} }
num_commands = 0; num_commands = 0;
if (atoi(Epplet_query_config_def("Save_History", "1"))) if (save_history)
Epplet_modify_multi_config("Command", command_history, num_commands); Epplet_modify_multi_config("Command", command_history, num_commands);
Epplet_add_popup_entry(history_popup, "-Empty-", NULL, NULL, NULL); Epplet_add_popup_entry(history_popup, "-Empty-", NULL, NULL, NULL);
@ -173,7 +189,7 @@ fill_popup(void)
{ {
for (i = 0; i < num_results; i++) for (i = 0; i < num_results; i++)
{ {
Epplet_add_popup_entry(history_popup, results[i], NULL, change_textbox, Epplet_add_popup_entry(history_popup, results[i], NULL, exec_popup,
strdup(results[i])); strdup(results[i]));
command_history[i] = strdup(results[i]); command_history[i] = strdup(results[i]);
num_commands = i + 1; num_commands = i + 1;
@ -199,6 +215,8 @@ cb_ok(void *data)
sprintf(buff, "%d", save_history); sprintf(buff, "%d", save_history);
Epplet_modify_config("Save_History", buff); Epplet_modify_config("Save_History", buff);
sprintf(buff, "%d", auto_run);
Epplet_modify_config("Autorun", buff);
return; return;
data = NULL; data = NULL;
@ -220,14 +238,18 @@ cb_configure(void *data)
return; return;
delete_history = FALSE; delete_history = FALSE;
config_win = Epplet_create_window_config(220, 60, "E-Exec Configuration", cb_ok, NULL, NULL, NULL, cb_cancel, NULL); config_win = Epplet_create_window_config(220, 76, "E-Exec Configuration", cb_ok, NULL, NULL, NULL, cb_cancel, NULL);
Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 6, 12, 12, &save_history, NULL, NULL)); Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 6, 12, 12, &save_history, NULL, NULL));
Epplet_gadget_show(Epplet_create_label(22, 6, "Save command history?", 2)); Epplet_gadget_show(Epplet_create_label(22, 6, "Save command history?", 2));
Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 22, 12, 12, &delete_history, NULL, NULL)); Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 22, 12, 12, &auto_run, NULL, NULL));
Epplet_gadget_show(Epplet_create_label(22, 22, "Empty command popup now?", 2)); Epplet_gadget_show(Epplet_create_label(22, 22, "Autorun popup selection?", 2));
Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 38, 12, 12, &delete_history, NULL, NULL));
Epplet_gadget_show(Epplet_create_label(22, 38, "Empty command popup now?", 2));
Epplet_window_show(config_win); Epplet_window_show(config_win);
Epplet_window_pop_context(); Epplet_window_pop_context();
return; return;
data = NULL;
} }
int int
@ -260,6 +282,7 @@ main(int argc, char *argv[])
Epplet_load_config(); Epplet_load_config();
save_history = atoi(Epplet_query_config_def("Save_History", "1")); save_history = atoi(Epplet_query_config_def("Save_History", "1"));
auto_run = atoi(Epplet_query_config_def("Autorun", "0"));
Epplet_gadget_show(Epplet_create_button(NULL, NULL, 2, 2, Epplet_gadget_show(Epplet_create_button(NULL, NULL, 2, 2,
12, 12, "CLOSE", 0, NULL, 12, 12, "CLOSE", 0, NULL,

View File

@ -178,7 +178,9 @@ enable_lighting(void)
GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
GLfloat mat_amb_diff[] = {.447, .243, .678}; GLfloat mat_amb_diff[] = {.447, .243, .678};
GLfloat mat_shininess[] = {100.0}; GLfloat mat_shininess[] = {100.0};
#if 0
GLfloat light_position[] = {0.0, 0.0, 1.0, 0.0}; GLfloat light_position[] = {0.0, 0.0, 1.0, 0.0};
#endif /* Unused */
GLfloat white_light[] = {1.0, 1.0, 1.0, 1.0}; GLfloat white_light[] = {1.0, 1.0, 1.0, 1.0};
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);