コード例 #1
0
int
main(int argc, char **argv)
{

   int                 prio;

   atexit(Epplet_cleanup);
   prio = getpriority(PRIO_PROCESS, getpid());
   setpriority(PRIO_PROCESS, getpid(), prio + 10);
   Epplet_Init("E-Sys", "0.1", "Enlightenment Uptime Epplet", 3, 3, argc, argv,
	       0);

   close_button =
      Epplet_create_button(NULL, NULL, 34, 2, 0, 0, "CLOSE", 0, NULL, close_cb,
			   NULL);
   label1 = Epplet_create_label(4, 4, "Uptime", 1);
   label2 = Epplet_create_label(4, 16, "", 1);
   label3 = Epplet_create_label(4, 26, "", 1);
   label4 = Epplet_create_label(4, 36, "", 1);
   Epplet_gadget_show(label1);
   Epplet_gadget_show(label2);
   Epplet_gadget_show(label3);
   Epplet_gadget_show(label4);
   Epplet_show();

   Epplet_register_focus_in_handler(in_cb, NULL);
   Epplet_register_focus_out_handler(out_cb, NULL);
   timer_cb(NULL);		/* Set everything up */
   Epplet_Loop();

   return 0;
}
コード例 #2
0
ファイル: E-Bandwidth.c プロジェクト: Limsik/e17
static void
config_cb(void *data)
{
   if (config_win)
     {
	return;
     }

   config_win =
      Epplet_create_window_config(200, 100, "E-Bandwidth Configuration", ok_cb,
				  NULL, apply_cb, NULL, cancel_cb, NULL);

   Epplet_gadget_show(Epplet_create_label(4, 4, "Device:", 2));
   Epplet_gadget_show(cfg_tb_dev =
		      Epplet_create_textbox(NULL, device_string, 4, 18, 192, 20,
					    2, NULL, NULL));

   Epplet_gadget_show(Epplet_create_togglebutton
		      (NULL, NULL, 4, 50, 12, 12, &show_title, NULL, NULL));
   Epplet_gadget_show(Epplet_create_label(20, 50, "Show title?", 2));

   Epplet_window_show(config_win);
   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #3
0
ファイル: E-LoadMeter.c プロジェクト: Limsik/e17
int
main(int argc, char **argv)
{
   atexit(Epplet_cleanup);

   Epplet_Init("E-LoadMeter", "0.1", "Enlightenment CPU Load Epplet", 3, 3,
	       argc, argv, 0);

   close_button = Epplet_create_std_button("CLOSE", 2, 2, close_cb, NULL);
   Epplet_gadget_show(Epplet_create_label(4, 4, "CPU Load", 1));
   Epplet_gadget_show(label1 = Epplet_create_label(3, 15, "", 1));
   Epplet_gadget_show(label2 = Epplet_create_label(3, 26, "", 1));
   Epplet_gadget_show(label3 = Epplet_create_label(3, 36, "", 1));

   Epplet_gadget_show(vbar1 = Epplet_create_vbar(31, 15, 5, 30, 1, &one));
   Epplet_gadget_show(vbar2 = Epplet_create_vbar(36, 15, 5, 30, 1, &five));
   Epplet_gadget_show(vbar3 = Epplet_create_vbar(41, 15, 5, 30, 1, &fifteen));

   Epplet_register_focus_in_handler(in_cb, NULL);
   Epplet_register_focus_out_handler(out_cb, NULL);
   Epplet_register_delete_event_handler(delete_cb, NULL);

   Epplet_show();
   timer_cb(NULL);
   Epplet_Loop();
   return 0;
}
コード例 #4
0
ファイル: E-Time.c プロジェクト: Limsik/e17
int
main(int argc, char **argv)
{
   atexit(Epplet_cleanup);

   Epplet_Init("E-Time", "0.1", "Enlightenment Digital Clock Epplet", 3, 3,
	       argc, argv, 0);
   Epplet_load_config();
   parse_config();

   close_button = Epplet_create_std_button("CLOSE", 2, 2, close_cb, NULL);
   cfg_button = Epplet_create_std_button("CONFIGURE", 33, 2, config_cb, NULL);
   Epplet_gadget_show(label1 = Epplet_create_label(4 * just, 4, "", 1));
   Epplet_gadget_show(label2 = Epplet_create_label(4 * just, 15, "", 1));
   Epplet_gadget_show(label3 = Epplet_create_label(4 * just, 26, "", 1));
   Epplet_gadget_show(label4 = Epplet_create_label(4 * just, 36, "", 1));
   Epplet_register_focus_in_handler(in_cb, NULL);
   Epplet_register_focus_out_handler(out_cb, NULL);
   Epplet_register_delete_event_handler(delete_cb, NULL);

   Epplet_show();
   timer_cb(NULL);
   Epplet_Loop();
   return 0;
}
コード例 #5
0
ファイル: ConfigTestEpplet.c プロジェクト: Limsik/e17
int
main(int argc, char **argv)
{
   char                s[1024];
   char               *result = NULL;
   int                 use_count = 1;
   char              **results = NULL;
   int                 i, num_results;

   Epplet_Init("E-Config", "0.1", "Enlightenment Config Test Epplet",
	       5, 2, argc, argv, 0);
   Epplet_load_config();
   result = Epplet_query_config_def("USE_COUNT", "0");
   use_count = atoi(result);
   use_count++;
   Esnprintf(s, sizeof(s), "%i", use_count);
   Epplet_modify_config("USE_COUNT", s);

   printf("Dump before modification:\n");
   results = Epplet_query_multi_config("PARAMS", &num_results);
   for (i = 0; i < num_results; i++)
     {
	printf("%s\n", results[i]);
     }
   if (results)
     {
	free(results);
	results = NULL;
     }

   Epplet_modify_multi_config("PARAMS", argv, argc);

   printf("Dump after modification:\n");
   results = Epplet_query_multi_config("PARAMS", &num_results);
   for (i = 0; i < num_results; i++)
     {
	printf("%s\n", results[i]);
     }
   if (results)
      free(results);

   Esnprintf(s, sizeof(s), "Instance %i", Epplet_get_instance());
   Epplet_gadget_show(Epplet_create_label(10, 2, s, 0));

   Esnprintf(s, sizeof(s), "Used %i times.", use_count);
   Epplet_gadget_show(Epplet_create_label(10, 14, s, 0));

   Epplet_gadget_show(Epplet_create_button(NULL, NULL,
					   65, 2, 0, 0, "CLOSE", 0, NULL,
					   cb_close, NULL));
   Epplet_show();
   Epplet_Loop();
   return 0;
}
コード例 #6
0
ファイル: E-Bandwidth.c プロジェクト: Limsik/e17
int
main(int argc, char **argv)
{

   int                 prio;

   prio = getpriority(PRIO_PROCESS, getpid());
   setpriority(PRIO_PROCESS, getpid(), prio + 10);
   atexit(Epplet_cleanup);
   Epplet_Init("E-Bandwidth", "0.2", "Enlightenment Network I/O Monitor Epplet",
	       3, 3, argc, argv, 0);
   Epplet_load_config();
   parse_conf();

   title = Epplet_create_label(3, 3, "Net I/O", 1);
   if (show_title)
     {
	/* New arrangement */
	in_label = Epplet_create_label(3, 13, "I: 0 b/s", 1);
	out_label = Epplet_create_label(3, 30, "O: 0 b/s", 1);
	in_bar = Epplet_create_hbar(3, 22, 42, 7, 0, &in_val);
	out_bar = Epplet_create_hbar(3, 39, 42, 7, 0, &out_val);
	Epplet_gadget_show(title);
     }
   else
     {
	/* Old arrangement */
	in_label = Epplet_create_label(4, 4, "I: 0 b/s", 1);
	out_label = Epplet_create_label(4, 24, "O: 0 b/s", 1);
	in_bar = Epplet_create_hbar(4, 14, 40, 8, 0, &in_val);
	out_bar = Epplet_create_hbar(4, 36, 40, 8, 0, &out_val);
     }
   close_button =
      Epplet_create_button(NULL, NULL, 2, 2, 0, 0, "CLOSE", 0, NULL, close_cb,
			   NULL);
   cfg_button =
      Epplet_create_button(NULL, NULL, 33, 2, 0, 0, "CONFIGURE", 0, NULL,
			   config_cb, NULL);
   Epplet_gadget_show(in_label);
   Epplet_gadget_show(in_bar);
   Epplet_gadget_show(out_label);
   Epplet_gadget_show(out_bar);
   Epplet_show();

   Epplet_register_focus_in_handler(in_cb, NULL);
   Epplet_register_focus_out_handler(out_cb, NULL);
   timer_cb(NULL);		/* Set everything up */
   Epplet_Loop();

   return 0;
}
コード例 #7
0
ファイル: E-Xss.c プロジェクト: Limsik/e17
static void
config_cb(void *data)
{
   char                buff[128];
   unsigned int        h, y, i;

   if (config_win)
     {
	return;
     }

   hacks = (char **)realloc(hacks, sizeof(char *) * (++hack_cnt));

   cfg_tb_hacks = (Epplet_gadget *) malloc(sizeof(Epplet_gadget) * hack_cnt);
   memset(cfg_tb_hacks, 0, sizeof(Epplet_gadget) * hack_cnt);

   h = 70 + (hack_cnt * 41);
   config_win =
      Epplet_create_window_config(300, h, "E-Xss Configuration", ok_cb, NULL,
				  apply_cb, NULL, cancel_cb, NULL);

   sprintf(buff, "%3.2f", delay);
   Epplet_gadget_show(Epplet_create_label
		      (4, 4, "Delay between images (seconds):", 2));
   Epplet_gadget_show(cfg_tb_delay =
		      Epplet_create_textbox(NULL, buff, 4, 18, 292, 20, 2, NULL,
					    NULL));

   for (i = 0, y = 50; i < hack_cnt; i++)
     {
	Esnprintf(buff, sizeof(buff), "Hack #%d:", i);
	Epplet_gadget_show(Epplet_create_label(4, y, buff, 2));
	y += 14;
	Epplet_gadget_show(cfg_tb_hacks[i] =
			   Epplet_create_textbox(NULL,
						 ((i ==
						   hack_cnt -
						   1) ? NULL : hacks[i]), 4, y,
						 292, 20, 2, NULL, NULL));
	y += 27;
     }

   Epplet_window_show(config_win);
   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #8
0
ファイル: E-Magic.c プロジェクト: Limsik/e17
int
main(int argc, char **argv)
{
   srand(getpid() ^ time(NULL));
   atexit(Epplet_cleanup);

   Epplet_Init("E-Magic", "0.1", "Enlightenment Magic Eight Ball Epplet", w, h,
	       argc, argv, 0);
   Epplet_load_config();
   parse_config();

   label = Epplet_create_label(6, 6, "", 2);
   Epplet_gadget_show(picture =
		      Epplet_create_image_button(image, 3, 3, ((w * 16) - 6),
						 ((h * 16) - 6),
						 button_click_cb, NULL));
   close_button = Epplet_create_std_button("CLOSE", 3, 3, close_cb, NULL);
   cfg_button =
      Epplet_create_std_button("CONFIGURE", ((w * 16) - 15), 3, config_cb,
			       NULL);

   Epplet_register_focus_in_handler(in_cb, NULL);
   Epplet_register_focus_out_handler(out_cb, NULL);
   Epplet_register_delete_event_handler(delete_cb, NULL);
   Epplet_show();

   Epplet_Loop();

   return 0;
}
コード例 #9
0
int
main(int argc, char **argv)
{
   Epplet_Init("E-Power", "0.1", "Enlightenment Laptop Power Epplet",
	       3, 3, argc, argv, 0);
   atexit(Epplet_cleanup);
   Epplet_timer(cb_timer, NULL, 30.0, "TIMER");
   b_close = Epplet_create_button(NULL, NULL,
				  2, 2, 0, 0, "CLOSE", 0, NULL, cb_close, NULL);
   b_help = Epplet_create_button(NULL, NULL,
				 34, 2, 0, 0, "HELP", 0, NULL, cb_help, NULL);
   b_suspend = Epplet_create_button(NULL, NULL,
				    2, 34, 0, 0, "PAUSE", 0, NULL,
				    cb_suspend, NULL);
   b_sleep = Epplet_create_button(NULL, NULL,
				  34, 34, 0, 0, "STOP", 0, NULL,
				  cb_sleep, NULL);
   Epplet_gadget_show(image = Epplet_create_image(2, 2, 44, 24,
						  "E-Power-Bat-100.png"));
   Epplet_gadget_show(label =
		      Epplet_create_label(2, 28, "APM, ACPI\nmissing", 1));
   Epplet_register_focus_in_handler(cb_in, NULL);
   Epplet_register_focus_out_handler(cb_out, NULL);
   cb_timer(NULL);
   Epplet_show();
   Epplet_Loop();
   return 0;
}
コード例 #10
0
ファイル: E-Magic.c プロジェクト: Limsik/e17
static void
config_cb(void *data)
{
   char                buff[128];

   if (config_win)
     {
	return;
     }

   config_win =
      Epplet_create_window_config(300, 160, "E-Magic Configuration", ok_cb,
				  NULL, apply_cb, NULL, cancel_cb, NULL);

   Epplet_gadget_show(Epplet_create_label(4, 4, "Path to Image:", 2));
   Epplet_gadget_show(cfg_tb_image =
		      Epplet_create_textbox(NULL, image, 4, 18, 292, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(Epplet_create_label(4, 50, "Path to Answers File:", 2));
   Epplet_gadget_show(cfg_tb_ans_file =
		      Epplet_create_textbox(NULL, ans_file, 4, 64, 292, 20, 2,
					    NULL, NULL));

   sprintf(buff, "%3.2f", delay);
   Epplet_gadget_show(Epplet_create_label
		      (4, 96, "Show answer for how many seconds?", 2));
   Epplet_gadget_show(cfg_tb_delay =
		      Epplet_create_textbox(NULL, buff, 4, 110, 192, 20, 2,
					    NULL, NULL));

   Epplet_window_show(config_win);
   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #11
0
ファイル: E-cpuStat.c プロジェクト: zipotron/chapuzas
int main (int argc, char **argv)
{
  texto=malloc(8);
  textoTemperatura=malloc(8);
  atexit(Epplet_cleanup);
  Epplet_Init("E-cpuStat", "0.1", "Enlightenment cpu temp/freq",
	       3, 3, argc, argv, 0);
  Epplet_timer(temporizador, NULL, 0, "TIMER");
  botonCerrar=Epplet_create_button(NULL, NULL,
					   2, 2, 0, 0, "CLOSE", 0, NULL,
					   cerrar, NULL);
  Epplet_register_focus_in_handler(enFoco,NULL);
  Epplet_register_focus_out_handler(fueraFoco,NULL);
  barra = Epplet_create_vbar(32, 3, 12, 41,
				     1, &temperatura);
  Epplet_gadget_show(barra);
  visorNumerico=Epplet_create_label(3,35,texto,0);
  visorTemperatura=Epplet_create_label(6,18,textoTemperatura,0);
  Epplet_gadget_show(visorTemperatura);
  Epplet_gadget_show(visorNumerico);
  Epplet_show();
  Epplet_Loop();
  return 0;
}
コード例 #12
0
ファイル: E-Time.c プロジェクト: Limsik/e17
static void
config_cb(void *data)
{
   if (config_win)
     {
	return;
     }

   config_win =
      Epplet_create_window_config(200, 280, "E-Time Configuration", ok_cb, NULL,
				  apply_cb, NULL, cancel_cb, NULL);

   Epplet_gadget_show(Epplet_create_label(4, 4, "First Line:", 2));
   Epplet_gadget_show(cfg_tb_line1 =
		      Epplet_create_textbox(NULL, line1, 4, 18, 192, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(Epplet_create_label(4, 50, "Second Line:", 2));
   Epplet_gadget_show(cfg_tb_line2 =
		      Epplet_create_textbox(NULL, line2, 4, 64, 192, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(Epplet_create_label(4, 96, "Third Line:", 2));
   Epplet_gadget_show(cfg_tb_line3 =
		      Epplet_create_textbox(NULL, line3, 4, 110, 192, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(Epplet_create_label(4, 142, "Fourth Line:", 2));
   Epplet_gadget_show(cfg_tb_line4 =
		      Epplet_create_textbox(NULL, line4, 4, 156, 192, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(Epplet_create_label(4, 186, "Time Zone ($TZ):", 2));
   Epplet_gadget_show(cfg_tb_tz =
		      Epplet_create_textbox(NULL, timezone_str, 4, 200, 192, 20,
					    2, NULL, NULL));

   cfg_just = ((just == -1) ? 1 : 0);
   Epplet_gadget_show(Epplet_create_togglebutton
		      (NULL, NULL, 4, 232, 12, 12, &cfg_just, NULL, NULL));
   Epplet_gadget_show(Epplet_create_label(20, 232, "Right-justify text?", 2));

   Epplet_window_show(config_win);
   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #13
0
ファイル: E-UrlWatch.c プロジェクト: Limsik/e17
static void
create_epplet_layout(void)
{
   Epplet_gadget_show(lbl_url = Epplet_create_label(2, 34, " ", 0));

   Epplet_gadget_show(btn_close =
		      Epplet_create_std_button("CLOSE", 2, 2, cb_close, NULL));
   Epplet_gadget_show(btn_help =
		      Epplet_create_std_button("HELP", 16, 2, cb_help, NULL));
   Epplet_gadget_show(btn_www =
		      Epplet_create_text_button("WWW",
						4, 17, 28, 13,
						cb_shoot, "www"));
   Epplet_gadget_show(btn_ftp =
		      Epplet_create_text_button("FTP",
						34, 17, 28, 13,
						cb_shoot, "ftp"));
   Epplet_gadget_show(btn_wget =
		      Epplet_create_text_button("GET",
						64, 17, 28, 13,
						cb_shoot, "get"));
   btn_file_url = Epplet_create_text_button("New!",
					    30, 2, 34, 12,
					    cb_btn_file_url, NULL);
   Epplet_gadget_show(btn_conf =
		      Epplet_create_std_button("CONFIGURE",
					       82, 2, cb_config, NULL));
   url_p = Epplet_create_popup();
   Epplet_add_popup_entry(url_p, "Url List is currently empty", NULL, NULL,
			  NULL);
   Epplet_gadget_show(btn_urllist =
		      Epplet_create_popupbutton(NULL, NULL, 68, 2, 12, 12,
						"ARROW_DOWN", url_p));
   if (opt.check_url_file)
      Epplet_timer(check_url_file, NULL, 1, "URLCHECK_TIMER");
   display_string("Welcome to E-UrlWatch ;-)");
}
コード例 #14
0
ファイル: E-ScreenShoot.c プロジェクト: Limsik/e17
static void
cb_config(void *data)
{
   Epplet_gadget       lbl, btn_anim, btn_script, btn_view, btn_do_ftp,
      btn_ftp_passive;

   if (confwin)
      return;

   /* Save any cahnges made though the main window, so we can revert using
    * the cancel button */
   save_config();

   confwin =
      Epplet_create_window_config(390, 540, "E-ScreenShoot Config", ok_cb,
				  &confwin, apply_cb, &confwin, cancel_cb,
				  &confwin);

   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 8,
					  "Please choose a cloak animation",
					  2));
   Epplet_gadget_show(btn_anim =
		      Epplet_create_popupbutton(NULL, NULL, 20, 8, 12, 12,
						"ARROW_DOWN", p));

   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 24,
					  "Please choose a shot grabber", 2));
   Epplet_gadget_show(btn_anim =
		      Epplet_create_popupbutton(NULL, NULL, 20, 24, 12, 12,
						"ARROW_DOWN", grabber_p));

   Epplet_gadget_show(lbl = Epplet_create_label(20, 40, "Shot Directory:", 2));
   Epplet_gadget_show(txt_dir =
		      Epplet_create_textbox(NULL, opt.dir, 20, 55, 170, 20, 2,
					    NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(200, 40, "File Prefix:", 2));
   Epplet_gadget_show(txt_file_prefix =
		      Epplet_create_textbox(NULL, opt.file_prefix, 200, 55,
					    100, 20, 2, NULL, NULL));
   Epplet_gadget_show(lbl = Epplet_create_label(310, 40, "File Type:", 2));
   Epplet_gadget_show(txt_file_type =
		      Epplet_create_textbox(NULL, opt.file_type, 310, 55, 60,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(20, 80, "File Stamp:", 2));
   Epplet_gadget_show(txt_file_stamp =
		      Epplet_create_textbox(NULL, opt.file_stamp, 20, 95, 350,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(btn_view =
		      Epplet_create_togglebutton(NULL, NULL, 20, 130, 12, 12,
						 &opt.view_shot, NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 130, "View shot after taking?",
					  2));
   Epplet_gadget_show(lbl = Epplet_create_label(20, 145, "Image Viewer:", 2));
   Epplet_gadget_show(txt_viewer =
		      Epplet_create_textbox(NULL, opt.viewer, 20, 160, 350,
					    20, 2, NULL, NULL));
   Epplet_gadget_show(btn_script =
		      Epplet_create_togglebutton(NULL, NULL, 20, 195, 12, 12,
						 &opt.run_script, NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 195,
					  "Run script/program on shot after taking?",
					  2));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(20, 210, "Script/program to run:",
					  2));
   Epplet_gadget_show(txt_script =
		      Epplet_create_textbox(NULL, opt.script, 20, 225, 350,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(btn_do_ftp =
		      Epplet_create_togglebutton(NULL, NULL, 20, 250, 12, 12,
						 &opt.do_ftp, NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 250,
					  "Transfer shot by FTP after taking shot?",
					  2));
   Epplet_gadget_show(btn_ftp_passive =
		      Epplet_create_togglebutton(NULL, NULL, 20, 265, 12, 12,
						 &opt.ftp_passive, NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(40, 265, "Use Passive FTP?", 2));

   Epplet_gadget_show(lbl = Epplet_create_label(20, 280, "FTP Host:", 2));
   Epplet_gadget_show(txt_ftp_host =
		      Epplet_create_textbox(NULL, opt.ftp_host, 20, 295, 350,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(20, 320, "FTP User:"******"FTP Password:"******"FTP Directory:", 2));
   Epplet_gadget_show(txt_ftp_dir =
		      Epplet_create_textbox(NULL, opt.ftp_dir, 20, 415, 350,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(20, 440, "FTP filename:", 2));
   Epplet_gadget_show(txt_ftp_file =
		      Epplet_create_textbox(NULL, opt.ftp_file, 20, 455, 350,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(lbl =
		      Epplet_create_label(20, 480,
					  "FTP temp filename (for uploading):",
					  2));
   Epplet_gadget_show(txt_ftp_temp =
		      Epplet_create_textbox(NULL, opt.ftp_temp, 20, 495, 350,
					    20, 2, NULL, NULL));

   Epplet_window_show(confwin);

   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #15
0
ファイル: E-UrlWatch.c プロジェクト: Limsik/e17
static void
cb_config(void *data)
{
   Epplet_gadget       lbl, btn_check_file, btn_save, btn_do_new_url_command,
      btn_always_show_file_urls;

   if (confwin)
      return;

   /* Save any cahnges made though the main window, so we can revert using
    * the cancel button */
   save_config();

   /* Create the window using my lovely config window api ;) */
   confwin =
      Epplet_create_window_config(440, 360, "E-UrlWatch Config", ok_cb,
				  &confwin, apply_cb, &confwin, cancel_cb,
				  &confwin);

   /* Put stuff in the window */
   Epplet_gadget_show(lbl = Epplet_create_label(10, 10, "WWW Command:", 2));
   Epplet_gadget_show(txt_www_command =
		      Epplet_create_textbox(NULL, opt.www_command, 10, 25,
					    420, 20, 2, NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(10, 50, "FTP Command:", 2));
   Epplet_gadget_show(txt_ftp_command =
		      Epplet_create_textbox(NULL, opt.ftp_command, 10, 65,
					    420, 20, 2, NULL, NULL));

   Epplet_gadget_show(lbl = Epplet_create_label(10, 90, "GET Command:", 2));
   Epplet_gadget_show(txt_get_command =
		      Epplet_create_textbox(NULL, opt.get_command, 10, 105,
					    420, 20, 2, NULL, NULL));

   Epplet_draw_line(confwin, 130, 0, 130, 440, 0, 0, 0);

   Epplet_gadget_show(btn_save =
		      Epplet_create_togglebutton(NULL, NULL, 10, 135, 12, 12,
						 &opt.save_urls, NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(30, 135,
					  "Save all urls handled?", 2));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(10, 150, "File to save urls in:", 2));
   Epplet_gadget_show(txt_url_save_file =
		      Epplet_create_textbox(NULL, opt.url_save_file, 10, 165,
					    420, 20, 2, NULL, NULL));

   Epplet_gadget_show(btn_check_file =
		      Epplet_create_togglebutton(NULL, NULL, 10, 195, 12, 12,
						 &opt.check_url_file, NULL,
						 NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(30, 195,
					  "Watch a file for new urls? (Eg. Third Eye Url Catcher)",
					  2));
   Epplet_gadget_show(lbl = Epplet_create_label(20, 210, "File to watch:", 2));
   Epplet_gadget_show(txt_url_file =
		      Epplet_create_textbox(NULL, opt.url_file, 10, 225, 420,
					    20, 2, NULL, NULL));

   Epplet_gadget_show(btn_do_new_url_command =
		      Epplet_create_togglebutton(NULL, NULL, 10, 255, 12, 12,
						 &opt.do_new_url_command,
						 NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(30, 255,
					  "Run command when a new url is detected?",
					  2));
   Epplet_gadget_show(lbl = Epplet_create_label(10, 270, "Command to run:", 2));
   Epplet_gadget_show(txt_new_url_command =
		      Epplet_create_textbox(NULL, opt.new_url_command, 10,
					    285, 420, 20, 2, NULL, NULL));

   Epplet_gadget_show(btn_always_show_file_urls =
		      Epplet_create_togglebutton(NULL, NULL, 10, 315, 12, 12,
						 &opt.always_show_file_urls,
						 NULL, NULL));
   Epplet_gadget_show(lbl =
		      Epplet_create_label(30, 315,
					  "Automatically launch every new url in watched file?",
					  2));

   Epplet_window_show(confwin);

   Epplet_window_pop_context();

   return;
   data = NULL;
}
コード例 #16
0
static void
config_cb(void *data)
{
   char                buff[128];
   unsigned long       ch, y, i;
   int                 x = 4;
   int                 row_w, col_w, height_w, width_w;
   Epplet_gadget       tmp_gad;

   if (config_win)
     {
	return;
     }

   cfg_gads =
      (tool_config_t *) malloc(sizeof(tool_config_t) * (button_cnt + 3));
   memset(cfg_gads, 0, sizeof(tool_config_t) * (button_cnt + 3));

   ch = 40 + ((button_cnt + 3) * 30);
   config_win =
      Epplet_create_window_config(535, ch, "E-Toolbox Configuration", ok_cb,
				  NULL, apply_cb, NULL, cancel_cb, NULL);

   tmp_gad = Epplet_create_label(x, 4, "Button:", 2);
   Epplet_gadget_show(tmp_gad);
   x += 100;

   tmp_gad = Epplet_create_label(x, 4, "Label:", 2);
   Epplet_gadget_show(tmp_gad);
   x += 100;

   tmp_gad = Epplet_create_label(x, 4, "Image:", 2);
   Epplet_gadget_show(tmp_gad);
   x += 100;

   tmp_gad = Epplet_create_label(x, 4, "Row:", 2);
   Epplet_gadget_show(tmp_gad);
   row_w = Epplet_gadget_get_width(tmp_gad);
   x += row_w + 10;

   tmp_gad = Epplet_create_label(x, 4, "Column:", 2);
   Epplet_gadget_show(tmp_gad);
   col_w = Epplet_gadget_get_width(tmp_gad);
   x += col_w + 10;

   tmp_gad = Epplet_create_label(x, 4, "Width:", 2);
   Epplet_gadget_show(tmp_gad);
   width_w = Epplet_gadget_get_width(tmp_gad);
   x += width_w + 10;

   tmp_gad = Epplet_create_label(x, 4, "Height:", 2);
   Epplet_gadget_show(tmp_gad);
   height_w = Epplet_gadget_get_width(tmp_gad);
   x += height_w + 10;

   tmp_gad = Epplet_create_label(x, 4, "Popup:", 2);
   Epplet_gadget_show(tmp_gad);

   for (i = 0, y = 20, x = 4; i < button_cnt; i++, y += 30, x = 4)
     {

	cfg_gads[i].cfg_tb_prog =
	   Epplet_create_textbox(NULL, buttons[i].prog, x, y, 90, 20, 2, NULL,
				 NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_prog);
	x += 100;

	cfg_gads[i].cfg_tb_label =
	   Epplet_create_textbox(NULL, buttons[i].label, x, y, 90, 20, 2, NULL,
				 NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_label);
	x += 100;

	cfg_gads[i].cfg_tb_image =
	   Epplet_create_textbox(NULL, buttons[i].image, x, y, 90, 20, 2, NULL,
				 NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_image);
	x += 100;

	Esnprintf(buff, sizeof(buff), "%u", (unsigned)buttons[i].y);
	cfg_gads[i].cfg_tb_y =
	   Epplet_create_textbox(NULL, buff, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_y);
	x += row_w + 14;

	Esnprintf(buff, sizeof(buff), "%u", (unsigned)buttons[i].x);
	cfg_gads[i].cfg_tb_x =
	   Epplet_create_textbox(NULL, buff, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_x);
	x += col_w + 10;

	Esnprintf(buff, sizeof(buff), "%u", (unsigned)buttons[i].w);
	cfg_gads[i].cfg_tb_w =
	   Epplet_create_textbox(NULL, buff, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_w);
	x += width_w + 10;

	Esnprintf(buff, sizeof(buff), "%u", (unsigned)buttons[i].h);
	cfg_gads[i].cfg_tb_h =
	   Epplet_create_textbox(NULL, buff, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_h);
	x += height_w + 10;

	Esnprintf(buff, sizeof(buff), "%ld", buttons[i].popup);
	cfg_gads[i].cfg_tb_popup =
	   Epplet_create_textbox(NULL, ((buttons[i].popup != -1) ? buff : NULL),
				 x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_popup);
     }
   for (x = 4; i < button_cnt + 3; i++, y += 30, x = 4)
     {
	cfg_gads[i].cfg_tb_prog =
	   Epplet_create_textbox(NULL, NULL, x, y, 90, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_prog);
	x += 100;

	cfg_gads[i].cfg_tb_label =
	   Epplet_create_textbox(NULL, NULL, x, y, 90, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_label);
	x += 100;

	cfg_gads[i].cfg_tb_image =
	   Epplet_create_textbox(NULL, NULL, x, y, 90, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_image);
	x += 100;

	cfg_gads[i].cfg_tb_y =
	   Epplet_create_textbox(NULL, NULL, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_y);
	x += row_w + 14;

	cfg_gads[i].cfg_tb_x =
	   Epplet_create_textbox(NULL, NULL, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_x);
	x += col_w + 10;

	cfg_gads[i].cfg_tb_w =
	   Epplet_create_textbox(NULL, NULL, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_w);
	x += width_w + 10;

	cfg_gads[i].cfg_tb_h =
	   Epplet_create_textbox(NULL, NULL, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_h);
	x += height_w + 10;

	cfg_gads[i].cfg_tb_popup =
	   Epplet_create_textbox(NULL, NULL, x, y, 24, 20, 2, NULL, NULL);
	Epplet_gadget_show(cfg_gads[i].cfg_tb_popup);
     }

   x = 10;
   y = ch - 25;
   tmp_gad = Epplet_create_label(x, y + 4, "Total Epplet Width:", 2);
   Epplet_gadget_show(tmp_gad);
   x += Epplet_gadget_get_width(tmp_gad) + 8;

   Esnprintf(buff, sizeof(buff), "%u", (unsigned)w);
   cfg_tb_width =
      Epplet_create_textbox(NULL, buff, x, y, 32, 20, 2, NULL, NULL);
   Epplet_gadget_show(cfg_tb_width);
   x += 45;

   tmp_gad = Epplet_create_label(x, y + 4, "Total Epplet Height:", 2);
   Epplet_gadget_show(tmp_gad);
   x += Epplet_gadget_get_width(tmp_gad) + 8;

   Esnprintf(buff, sizeof(buff), "%u", (unsigned)h);
   cfg_tb_height =
      Epplet_create_textbox(NULL, buff, x, y, 32, 20, 2, NULL, NULL);
   Epplet_gadget_show(cfg_tb_height);

   Epplet_window_show(config_win);
   Epplet_window_pop_context();

   return;
   data = NULL;
}