Пример #1
0
EAPI void
ede_game_quit(void)
{
   ecore_main_loop_quit();
}
static Eina_Bool timerFired(void*)
{
    timer = 0;
    ecore_main_loop_quit();
    return ECORE_CALLBACK_CANCEL;
}
Пример #3
0
static int
exit_cb (void *ev, int ev_type, void *data)
{
  ecore_main_loop_quit ();
  return (0);
}
Пример #4
0
void RunLoop::stop()
{
    ecore_main_loop_quit();
}
static void
_destroy(Ecore_Evas *ee)
{
   printf("destroy\n");
   ecore_main_loop_quit();
}
Пример #6
0
void
completion_cb(void *data, const char *file, int status)
{
   printf("Done (status: %d)\n", status);
   ecore_main_loop_quit();
}
Пример #7
0
static void user_menu_handler(void *data, Evas *e, Evas_Object *obj, void *event){
	Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event;

//	if (strcmp (ev->keyname, "f") == 0)
//		ecore_evas_fullscreen_set (core.ee_core, !ecore_evas_fullscreen_get (core.ee_core));
//	else


	if (strcmp (ev->keyname, "Start") == 0){
		if(!is_download && !is_downloading && get_download_status()!=IS_DOWNLOADING)
			ecore_main_loop_quit();
	}else if (strcmp (ev->keyname, "Circle") == 0){
		if(is_main_menu);
		else if(is_asking_exit_to_xmb){
			is_asking_exit_to_xmb = false;
			is_abort = false;
			hide_edj(&download_ask);
		}else if(is_download){
			is_download = false;
			hide_obj(down);
			hide_edj(&download_perc);
			hide_edj(&download);
		}else if(is_downloading){
			is_abort = true;
	//		ecore_file_download_abort_all();
		}else if(!is_downloading && get_download_status()!=IS_DOWNLOADING){
			for(int i=0;i<Apps[category].n_elem && category !=5;i++)
				hide_obj(Applications[category].Image[i].obj);
			is_main_menu = true;
			is_drawn = category = x = y = 0;
			show_edj(&menu[0]);
			show_edj(&menu[1]);
			show_edj(&menu[2]);
			show_edj(&bar);
			app=0;
			override_text(&bar, "app_type_text", "");
			override_text(&bar, "app_version_text", "");
		}else{
			is_downloading = false;
			is_download = false;
			evas_object_resize(down, 1, Bar_Y_Val);
		}
	}else if (strcmp (ev->keyname, "Left") == 0 && !is_download) 
		x--;
	else if (strcmp (ev->keyname, "Right") == 0 && !is_download)
		x++;
	else if (strcmp (ev->keyname, "Up") == 0 && !is_download){
		if(!y)
			app-=6;
		y=!y;
	}else if (strcmp (ev->keyname, "Down") == 0 && !is_download){
		if(y)
			app+=6;
		y=!y;
	}else if (strcmp (ev->keyname, "Cross") == 0 && !is_download){
		if(is_main_menu){
			category = y*3+x;
			app = x = y = 0;
			is_drawn = 2;
			hide_edj(&menu[2]); //main menu
			if(category==5)
				hide_edj(&menu[1]); // sub menu
		}else if(is_asking_exit_to_xmb){
			is_asking_exit_to_xmb = false;
			ecore_main_loop_quit();
		}else if(app+(y*3+x) < Apps[category].n_elem){
			override_text(&download, "d_name_text", Apps[category].name[app+(y*3+x)].c_str());
			override_text(&download_perc, "d_perc_text", " ");
/*
		// uncomment this only if you have in the xml the file size (you need to edit also application.h and .cpp
			char dst[100];
			if(Apps[category].file_size[app+(y*3+x)]>1000000000)
				sprintf(dst,"%.2f Gb",1.*Apps[category].file_size[app+(y*3+x)]/1000000000);
			else if(Apps[category].file_size[app+(y*3+x)]>1000000)
				sprintf(dst,"%.2f Mb",1.*Apps[category].file_size[app+(y*3+x)]/1000000);
			else if(Apps[category].file_size[app+(y*3+x)]>1000)
				sprintf(dst,"%.2f Kb",1.*Apps[category].file_size[app+(y*3+x)]/1000);
			else
				sprintf(dst,"%d Bytes",1.*Apps[category].file_size[app+(y*3+x)]);
			override_text(&download_perc, "d_perc_text", dst);

*/
			show_edj(&download);
			show_edj(&download_perc);
			show_obj(down);
			is_download = true;
		}
		is_main_menu = false;
	}else if (strcmp (ev->keyname, "Cross") == 0 && is_download && !is_downloading){
		override_text(&download, "d_name_text", Apps[category].name[app+(y*3+x)].c_str());
		int ret = 7;
		show_obj(down);
		show_edj(&download);
		show_edj(&download_perc);
		download_status = 0;
		char dst[100];
		sprintf(dst,"%s/%s",CACHE_PATH,Apps[category].pkg_file[app+(y*3+x)].c_str());
		if(file_exist(dst))
			file_delete(dst);
		download_file(Apps[category].link[app+(y*3+x)].c_str(), dst, download_func_curl, download_is_finished);
//		ecore_file_download(Apps[category].link[app+(y*3+x)].c_str(), dst, download_is_finished, download_func, NULL, NULL);
	 	
	}
	
	if(x<0)
		x = 2;
	else if(x>2)
		x = 0;
	if(app<0)
		app=0;

	if(category != 5){
		if(is_main_menu)
			override_text(&bar, "menu_text", Categories_Names[y*3+x].c_str());
		else{
			if(app > Apps[category].n_elem-1)
				app -=6;
			override_text(&bar, "menu_text", (app+(y*3+x) < Apps[category].n_elem) ? (Apps[category].name[app+(y*3+x)].c_str()) : "" );
			override_text(&bar, "app_version_text", (app+(y*3+x) < Apps[category].n_elem) ? (Apps[category].version[app+(y*3+x)].c_str()) : "" );
			char page[20];
			sprintf(page,"%d/%d",app+(y*3+x)+1,Apps[category].n_elem);
			override_text(&menu[1], "page_of", page);
			switch(Apps[category].type_file[app+(y*3+x)]){
			 		case PSC_PACKAGE:
						override_text(&bar, "app_type_text", "Package");
			 			break;
			 		case PSC_THEME:
						override_text(&bar, "app_type_text", "Theme");
			 			break;
			 		case PSC_IMAGE:
						override_text(&bar, "app_type_text", "Image");
			 			break;
			 		case PSC_VIDEO:
						override_text(&bar, "app_type_text", "Video");
			 			break;
			 		case PSC_NO_TYPE:
						override_text(&bar, "app_type_text", " ");
			 			break;
			 		default:
						override_text(&bar, "app_type_text", " ");
			 			break;
			}
			for(int i=0;i<Apps[category].n_elem;i++)
				hide_obj(Applications[category].Image[i].obj);
			for(int i=0;i<6 && i+app < Apps[category].n_elem;i++)
				show_obj(Applications[category].Image[app+i].obj);
		}
		move_edj(&bar, Cursor_X[x], Cursor_Y[y]);
	}else{
		hide_edj(&bar);
	}
}
Пример #8
0
Eina_Bool
timer1_tick(void *data)
{
   printf("Once only timer called at %3.2f seconds, data %p\n",
	  ecore_time_get(), data);
   fprintf(stderr, "This is an error message from the timer callback.\n");
   fprintf(stdout, "This is an output message from the timer callback.\n");
   fprintf(stderr,
	   "Some text for testing the various problems that may occur.  It should all be to stderr.\n");
   fprintf(stderr, "!@#$%%^&*(){}|[]\\/\\\\=?+',.\"<>`~-_;:\n");
   fprintf(stderr, "1234567890\n");
   fprintf(stderr, "abcdefghijklmnopqrstuvwxyz\n");
   fprintf(stderr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n");
   fprintf(stderr,
	   "This is a really long line that is used to test the systems response to really long lines.  Having said that, if I hadn't added this extra sentence it would not have been as long as the introduction line that is five lines above this one.  If you got this far, then you may actually have no life, as this is just a really long test line that says nothing important, and the only parts that have any actual relevance are the beginning and the end.\n");
   fprintf(stderr,
	   "This line is almost identical to the one above, only \\n's ae added to test multiline.\nThis is a really long line that is used to test the systems response to really long lines.\nHaving said that, if I hadn't added this extra sentence it would not have been as long as the introduction line that is five lines above this one.\nIf you got this far, then you may actually have no life, as this is just a really long test line that says nothing important, and the only parts that have any actual relevance are the beginning and the\nend.\n");
   fprintf(stderr, "&gt;&amp;&lt; == <&>\n");
   fprintf(stderr, "This - <br> - is a HTML line break.\n");
   fprintf(stderr, "&gt;br&lt; == <br>\n");
   fprintf(stderr,
	   "The rest is just some lines cut and paste from http://matrix-rad.net/ coz I need a big lump of text, and it was handy.  Used with the permission of the author, coz I (David 'onefang' Seikel) am the author, apply the standard E17 license to this part when it is part of E17 cvs.\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "NAWS stands for Not A Widget Set, it will not be a widget set, it will be a\n");
   fprintf(stderr,
	   "single, generalised widget and a single generalized widget container.\n");
   fprintf(stderr, "  </P>\n");
   fprintf(stderr, "  <P>\n");
   fprintf(stderr, "The idea is roughly this -<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "NAWS should allow pixel perfect layout on any OS/JVM combination. This is very\n");
   fprintf(stderr,
	   "important, it gives the GUI designers the freedom from differences that has been\n");
   fprintf(stderr, "sorely lacking on the web.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "All widgets should be shaped, so that you can have two roundish widgets\n");
   fprintf(stderr,
	   "snuggling up to each other. All widgets should be font sensitive, this could\n");
   fprintf(stderr,
	   "break pixel perfection though. The shape should be definable by a mask graphic,\n");
   fprintf(stderr, "or a combination of graphics primitives.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Labels should be able to display multiline flowed text or a graphic, with the\n");
   fprintf(stderr,
	   "graphic being a .png, .jpg, .gif (in that order of preference), and with\n");
   fprintf(stderr,
	   "animation support. Labels should be able to be attached to all other widgets as\n");
   fprintf(stderr,
	   "prompts. Labels should have automatic disabled graphics (ghosting) created and\n");
   fprintf(stderr,
	   "the option of supplying one. So that a widgets prompt gets ghosted when the\n");
   fprintf(stderr,
	   "widget gets ghosted, and to provide ghosting support for the other widget types.\n");
   fprintf(stderr,
	   "Labels can have a different text / graphic for the mouse hover state. Label\n");
   fprintf(stderr, "graphics should naturally be paintable.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Borders are shaped outlines that can be put around anything. Not really a\n");
   fprintf(stderr,
	   "widget, just a decoration. When using graphics, the border could be part of the\n");
   fprintf(stderr,
	   "graphic, so no actual border is needed. Might be able to make Labels as\n");
   fprintf(stderr, "containers do the job of Borders.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Buttons are Labels that can be clicked. Alternate text / graphics for the\n");
   fprintf(stderr,
	   "clicked state should be catered for. Radio buttons can be handled by widget\n");
   fprintf(stderr,
	   "notification. Checkboxes are buttons that are sticky. The difference between\n");
   fprintf(stderr,
	   "Checkboxes and toggled Buttons is purely cosmetic.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr, "Icons are movable Buttons.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Text editing fields are Labels that allow the text to be edited. Masks and\n");
   fprintf(stderr, "validation should be built in.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Progress indicators are Labels with two graphics where the first graphic is\n");
   fprintf(stderr,
	   "slowly revealed by chipping away at the second overlayed graphic. Default\n");
   fprintf(stderr, "graphics should be supplied.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "Containers should be automatically scrollable if needed. Actually, Containers\n");
   fprintf(stderr,
	   "could be just Labels that allow sub widgets, but I don't think I will go that\n");
   fprintf(stderr, "far B-). On second thoughts, I might.<BR><BR>\n");
   fprintf(stderr, "\n");
   fprintf(stderr,
	   "All else is really just a Container with several of the basic widgets in them. A\n");
   fprintf(stderr,
	   "List is just a collection of Buttons. A Menu is not very different from a List\n");
   fprintf(stderr,
	   "with sub Lists. Choices are Lists where the selected item is usually all that is\n");
   fprintf(stderr, "\n");
   ecore_main_loop_quit();
   return EINA_FALSE;
}
Пример #9
0
static void
_on_key_down(void *data, Evas *e, Evas_Object *o, void *event_info)
{
    Evas_Event_Key_Down *ev = event_info;
    Evas_Object *em = data;

    if (!strcmp(ev->keyname, "Return"))
    {
        emotion_object_play_set(em, EINA_TRUE);
    }
    else if (!strcmp(ev->keyname, "space"))
    {
        emotion_object_play_set(em, EINA_FALSE);
    }
    else if (!strcmp(ev->keyname, "Escape"))
    {
        ecore_main_loop_quit();
    }
    else if (!strcmp(ev->keyname, "t"))
    {
        int w, h;
        emotion_object_size_get(em, &w, &h);
        fprintf(stderr, "example -> size: %dx%d\n", w, h);
    }
    else if (!strcmp(ev->keyname, "s"))
    {
        float len, pos;
        len = emotion_object_play_length_get(em);
        pos = 0.98 * len;
        fprintf(stderr, "skipping to position %0.3f\n", pos);
        emotion_object_position_set(em, pos);
    }
    else if (!strcmp(ev->keyname, "1"))
    {
        fprintf(stderr, "setting speed to 1.0\n");
        emotion_object_play_speed_set(em, 1.0);
    }
    else if (!strcmp(ev->keyname, "2"))
    {
        fprintf(stderr, "setting speed to 2.0\n");
        emotion_object_play_speed_set(em, 2.0);
    }
    else if (!strcmp(ev->keyname, "n"))
    {
        const char *file;
        if (!curfile)
            curfile = filenames;
        else
            curfile = eina_list_next(curfile);
        file = eina_list_data_get(curfile);
        fprintf(stderr, "playing next file: %s\n", file);
        emotion_object_file_set(em, file);
    }
    else if (!strcmp(ev->keyname, "p"))
    {
        const char *file;
        if (!curfile)
            curfile = eina_list_last(filenames);
        else
            curfile = eina_list_prev(curfile);
        file = eina_list_data_get(curfile);
        fprintf(stderr, "playing next file: %s\n", file);
        emotion_object_file_set(em, file);
    }
    else if (!strcmp(ev->keyname, "d"))
    {
        evas_object_del(em);
    }
    else if (!strcmp(ev->keyname, "l"))
    {
        // force frame dropping
        sleep(5);
    }
    else
    {
        fprintf(stderr, "unhandled key: %s\n", ev->keyname);
    }
}
Пример #10
0
Файл: efreetd.c Проект: tasn/efl
void
quit(void)
{
   ecore_main_loop_quit();
}
Пример #11
0
static int sig_exit_cb(void * data, int ev_type, void * ev)
{
    ecore_main_loop_quit();
    return 1;
}
Пример #12
0
static void
_ertf_cb_delete (Ecore_Evas *ee)
{
  ecore_main_loop_quit();
}
Пример #13
0
static Eina_Bool idle_out_cb( void *data )
{
    ecore_main_loop_quit();
    return ECORE_CALLBACK_RENEW;
}
Пример #14
0
/*Main loop will return from idle state if polled. */
static Eina_Bool idle_in_cb( void *data )
{
    if ( poll_event_queue )
        ecore_main_loop_quit();
    return ECORE_CALLBACK_RENEW;
}
Пример #15
0
static void
_test_error_cb(int error, void *data)
{
   fprintf(stderr, "error: [%s]\n", strerror(error));
   ecore_main_loop_quit();
}
Пример #16
0
static Eina_Bool
_quit(__UNUSED__ void *data)
{
   ecore_main_loop_quit();
   return ECORE_CALLBACK_CANCEL;
}
Пример #17
0
static void
_test_done_cb(void *data)
{
   printf("copy done\n");
   ecore_main_loop_quit();
}
Пример #18
0
static void _ethemes_exit(void *data, Evas_Object *o, const char *emission, const char *source) {

       ecore_main_loop_quit();

}
Пример #19
0
static void
_on_delete(Ecore_Evas *ee)
{
   free(ecore_evas_data_get(ee, "key"));
   ecore_main_loop_quit();
}
Пример #20
0
static Eina_Bool main_signal_exit(void *data, int ev_type, void *ev)
{
    ecore_main_loop_quit();
    return EINA_TRUE;
}
Пример #21
0
static Eina_Bool on_exit_handler(void *data, int type, void *event){
	ecore_main_loop_quit();
	return 1;
}
Пример #22
0
static Eina_Bool
_on_input(__UNUSED__ void *data, Ecore_Fd_Handler *fd_handler)
{
   char buf[256];
   char *cmd, *args;
   const struct {
      const char *cmd;
      Eina_Bool (*cb)(char *cmd, char *args);
   } *itr, maps[] = {
     {"quit", _on_cmd_quit},
     {"sync", _on_cmd_sync},
     {"get_all", _on_cmd_get_all},
     {"print", _on_cmd_print},
     {"get_properties", _on_cmd_get_properties},
     {"set_property", _on_cmd_property_set},
     {"manager_get", _on_cmd_manager_get},
     {"manager_default_adapter", _on_cmd_manager_default_adapter},
     {"adapter_register_agent", _on_cmd_adapter_register_agent},
     {"adapter_unregister_agent", _on_cmd_adapter_unregister_agent},
     {"adapter_get_address", _on_cmd_adapter_get_address},
     {"adapter_get_name", _on_cmd_adapter_get_name},
     {"adapter_set_name", _on_cmd_adapter_set_name},
     {"adapter_get_powered", _on_cmd_adapter_get_powered},
     {"adapter_set_powered", _on_cmd_adapter_set_powered},
     {"adapter_get_discoverable", _on_cmd_adapter_get_discoverable},
     {"adapter_set_discoverable", _on_cmd_adapter_set_discoverable},
     {"adapter_get_discoverable_timeout", _on_cmd_adapter_get_discoverable_timeout},
     {"adapter_set_discoverable_timeout", _on_cmd_adapter_set_discoverable_timeout},
     {"adapter_get_discovering", _on_cmd_adapter_get_discovering},
     {"adapter_start_discovery", _on_cmd_adapter_start_discovery},
     {"adapter_stop_discovery", _on_cmd_adapter_stop_discovery},
     {"adapter_create_paired_device", _on_cmd_adapter_create_paired_device},
     {"device_get_name", _on_cmd_device_get_name},
     {NULL, NULL}
   };


   if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
     {
	fputs("ERROR: reading from stdin, exit\n", stderr);
	return EINA_FALSE;
     }

   if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
     {
	fputs("ERROR: nothing to read?\n", stderr);
	return EINA_FALSE;
     }

   if (!fgets(buf, sizeof(buf), stdin))
     {
	fprintf(stderr, "ERROR: could not read command: %s\n", strerror(errno));
	ecore_main_loop_quit();
	return EINA_FALSE;
     }

   cmd = buf;
   while (isspace(*cmd))
     cmd++;

   args = strchr(cmd, ' ');
   if (args)
     {
	char *p;

	*args = '\0';
	args++;

	while (isspace(*args))
	  args++;

	p = args + strlen(args) - 1;
	if (*p == '\n')
	  *p = '\0';
     }
   else
     {
	char *p;

	p = cmd + strlen(cmd) - 1;
	if (*p == '\n')
	  *p = '\0';
     }

   if (strcmp(cmd, "help") == 0)
     {
	if (args)
	  {
	     printf("Commands with '%s' in the name:\n", args);
	     for (itr = maps; itr->cmd; itr++)
	       if (strstr(itr->cmd, args))
		 printf("\t%s\n", itr->cmd);
	  }
	else
	  {
	     fputs("Commands:\n", stdout);
	     for (itr = maps; itr->cmd; itr++)
	       printf("\t%s\n", itr->cmd);
	  }
	fputc('\n', stdout);
	return ECORE_CALLBACK_RENEW;
     }

   for (itr = maps; itr->cmd; itr++)
     if (strcmp(itr->cmd, cmd) == 0)
       return itr->cb(cmd, args);

   printf("unknown command \"%s\", args=%s\n", cmd, args);
   return ECORE_CALLBACK_RENEW;
}
Пример #23
0
/* callback for quit call */
void ens_cb_menu_quit(void *data, Evas_Object * o, const char *emission,
		      const char *source) {
   ecore_main_loop_quit();
}
Пример #24
0
static Eina_Bool
exit_handler(void *param, int ev_type, void *event)
{
    ecore_main_loop_quit();
    return 1;
}
static void
_delete(Ecore_Evas *ee)
{
   printf("delete\n");
   ecore_main_loop_quit();
}
Пример #26
0
static void
main_win_close_handler(Ecore_Evas * main_win)
{
    ecore_main_loop_quit();
}
Пример #27
0
static void
window_del_cb (Ecore_Evas * ee)
{
  ecore_main_loop_quit ();
}
Пример #28
0
static void
mouse_down_back_button(void *d, Evas *e, Evas_Object *obj, void *event_info)
{
    ecore_main_loop_quit();
}
Пример #29
0
static void
_error_cb(void *data, Eio_File *handler, int error)
{
   fprintf(stderr, "Something wrong has happend:%s\n", strerror(error));
   ecore_main_loop_quit();
}
static void
ecore_dbus_method_error_cb(void *data, const char *error)
{
    printf("Error: %s\n", error);
    ecore_main_loop_quit();
}