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:
parent
ea366599a8
commit
3afb1042d3
|
@ -2000,3 +2000,9 @@ Mon Feb 28 19:50:20 GMT 2000
|
|||
|
||||
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.
|
||||
|
|
26
api/epplet.c
26
api/epplet.c
|
@ -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)
|
||||
Epplet_remember();
|
||||
need_remember = 0;
|
||||
Epplet_timer(remember_stuff, NULL, 10, "REMEMBER_TIMER");
|
||||
return;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -968,8 +971,10 @@ Epplet_remember(void)
|
|||
#ifdef NEW_REMEMBER
|
||||
#ifndef NO_AUTO_RESPAWN
|
||||
char commandbuf[] = "command";
|
||||
|
||||
#else
|
||||
char commandbuf[] = "";
|
||||
|
||||
#endif
|
||||
Esnprintf(s, sizeof(s), "remember %x none layer border location "
|
||||
"sticky shade group %s", (unsigned int)mainwin->win, commandbuf);
|
||||
|
@ -3996,8 +4001,8 @@ Epplet_event(Epplet_gadget gadget, XEvent * ev)
|
|||
case E_TEXTBOX:
|
||||
{
|
||||
GadTextBox *g;
|
||||
int tmp_x, tmp_y, width, length, index,
|
||||
last_index, text_w, text_h, text_wl, text_wr;
|
||||
int tmp_x, tmp_y, width, length, index, last_index,
|
||||
text_w, text_h, text_wl, text_wr;
|
||||
Window dummy;
|
||||
char buf, left = 1, right = 1;
|
||||
float delta;
|
||||
|
@ -5094,12 +5099,14 @@ Epplet_bind_double_GL(Epplet_gadget da, int red, int green, int blue,
|
|||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
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
|
||||
* 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,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
|
@ -5123,7 +5130,8 @@ Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
|
|||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
int attributeListSgl[]={GLX_RGBA,
|
||||
int attributeListSgl[] =
|
||||
{GLX_RGBA,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
|
|
|
@ -349,6 +349,8 @@ toggle_nice(void *data)
|
|||
sprintf(s, "%d", include_nice);
|
||||
Epplet_modify_config("nice", s);
|
||||
Epplet_save_config();
|
||||
return;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#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 MAX_HIST_LEN 15
|
||||
#define MAX_HIST_LEN 20
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
@ -14,7 +14,7 @@ Epplet_gadget history_popup = NULL;
|
|||
char *command_history[MAX_HIST_LEN];
|
||||
int current_command = 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;
|
||||
|
||||
static void cb_close(void *data);
|
||||
|
@ -24,6 +24,7 @@ static void hist_last(void *data);
|
|||
static void hist_next(void *data);
|
||||
static void empty_popup(void);
|
||||
static void fill_popup(void);
|
||||
static void exec_popup(void *data);
|
||||
static void cb_ok(void *data);
|
||||
static void cb_cancel(void *data);
|
||||
static void cb_configure(void *data);
|
||||
|
@ -42,8 +43,7 @@ run_contents(void *data)
|
|||
{
|
||||
char *command = Epplet_textbox_contents(textbox);
|
||||
int i;
|
||||
int command_exists, num_results;
|
||||
char **results;
|
||||
int command_exists;
|
||||
|
||||
if (!Epplet_popup_entry_get_data(history_popup, 0))
|
||||
Epplet_remove_popup_entry(history_popup, 0);
|
||||
|
@ -97,6 +97,22 @@ change_textbox(void *data)
|
|||
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
|
||||
hist_last(void *data)
|
||||
{
|
||||
|
@ -155,7 +171,7 @@ empty_popup(void)
|
|||
}
|
||||
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_add_popup_entry(history_popup, "-Empty-", NULL, NULL, NULL);
|
||||
|
@ -173,7 +189,7 @@ fill_popup(void)
|
|||
{
|
||||
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]));
|
||||
command_history[i] = strdup(results[i]);
|
||||
num_commands = i + 1;
|
||||
|
@ -199,6 +215,8 @@ cb_ok(void *data)
|
|||
|
||||
sprintf(buff, "%d", save_history);
|
||||
Epplet_modify_config("Save_History", buff);
|
||||
sprintf(buff, "%d", auto_run);
|
||||
Epplet_modify_config("Autorun", buff);
|
||||
|
||||
return;
|
||||
data = NULL;
|
||||
|
@ -220,14 +238,18 @@ cb_configure(void *data)
|
|||
return;
|
||||
|
||||
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_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_label(22, 22, "Empty command popup now?", 2));
|
||||
Epplet_gadget_show(Epplet_create_togglebutton(NULL, NULL, 6, 22, 12, 12, &auto_run, NULL, NULL));
|
||||
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_pop_context();
|
||||
|
||||
return;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -260,6 +282,7 @@ main(int argc, char *argv[])
|
|||
Epplet_load_config();
|
||||
|
||||
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,
|
||||
12, 12, "CLOSE", 0, NULL,
|
||||
|
|
|
@ -178,7 +178,9 @@ enable_lighting(void)
|
|||
GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
|
||||
GLfloat mat_amb_diff[] = {.447, .243, .678};
|
||||
GLfloat mat_shininess[] = {100.0};
|
||||
#if 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};
|
||||
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
|
||||
|
|
Loading…
Reference in New Issue