예제 #1
0
END_TEST

START_TEST(eo_op_not_found_in_super)
{
   eo_init();
   eina_log_print_cb_set(eo_test_print_cb, &ctx);

   Eo *obj = eo_add(SIMPLE_CLASS, NULL);
   fail_if(!obj);

   TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'.");
   eo_do_super(obj, SIMPLE_CLASS, simple_a_set(10));
   fail_unless(ctx.did);

   eo_unref(obj);
   eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
   eo_shutdown();
}
예제 #2
0
END_TEST

START_TEST(eo_api_not_implemented_call)
{
   eo_init();
   eina_log_print_cb_set(eo_test_print_cb, &ctx);

   Eo *obj = eo_add(SIMPLE_CLASS, NULL);
   fail_if(!obj);

   TEST_EO_ERROR("_eo_api_op_id_get", "in %s:%d: unable to resolve %s api func '%s' %p in class '%s'.");
   eo_do(obj, simple_no_implementation());
   fail_unless(ctx.did);

   eo_unref(obj);
   eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
   eo_shutdown();
}
예제 #3
0
int
ecore_wince_init()
{
    WNDCLASS wc;

    if (++_ecore_wince_init_count != 1)
        return _ecore_wince_init_count;

    if (!eina_init())
        return --_ecore_wince_init_count;

    eina_log_print_cb_set(_ecore_wince_error_print_cb, NULL);
    _ecore_wince_log_dom_global = eina_log_domain_register("ecore_wince", ECORE_WINCE_DEFAULT_LOG_COLOR);
    if (_ecore_wince_log_dom_global < 0)
    {
        EINA_LOG_ERR("Ecore_WinCE: Could not register log domain");
        goto shutdown_eina;
    }

    if (!ecore_event_init())
    {
        ERR("Ecore_WinCE: Could not init ecore_event");
        goto unregister_log_domain;
    }

    _ecore_wince_instance = GetModuleHandle(NULL);
    if (!_ecore_wince_instance)
    {
        ERR("GetModuleHandle() failed");
        goto shutdown_ecore_event;
    }

    memset (&wc, 0, sizeof (wc));
    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = _ecore_wince_window_procedure;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = _ecore_wince_instance;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
    wc.lpszMenuName =  NULL;
    wc.lpszClassName = ECORE_WINCE_WINDOW_CLASS;

    if(!RegisterClass(&wc))
    {
        ERR("RegisterClass() failed");
        goto free_library;
    }

    if (!ECORE_WINCE_EVENT_MOUSE_IN)
    {
        ECORE_WINCE_EVENT_MOUSE_IN              = ecore_event_type_new();
        ECORE_WINCE_EVENT_MOUSE_OUT             = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_FOCUS_IN       = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT      = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_DAMAGE         = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_CREATE         = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_DESTROY        = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_SHOW           = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_HIDE           = ecore_event_type_new();
        ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
    }

    return _ecore_wince_init_count;

free_library:
    FreeLibrary(_ecore_wince_instance);
shutdown_ecore_event:
    ecore_event_shutdown();
unregister_log_domain:
    eina_log_domain_unregister(_ecore_wince_log_dom_global);
shutdown_eina:
    eina_shutdown();

    return --_ecore_wince_init_count;
}
예제 #4
0
파일: edje_cc.c 프로젝트: tguillem/efl
int
main(int argc, char **argv)
{
   int i;
   struct stat st;
#ifdef HAVE_REALPATH
   char rpath[PATH_MAX], rpath2[PATH_MAX];
#endif

   setlocale(LC_NUMERIC, "C");

   ecore_app_no_system_modules();

   if (!eina_init())
     return -1;

   _edje_cc_log_dom = eina_log_domain_register
     ("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
   if (_edje_cc_log_dom < 0)
     {
       EINA_LOG_ERR("Enable to create a log domain.");
       exit(-1);
     }
   if (!eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_WARN))
     eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_WARN);

   progname = ecore_file_file_get(argv[0]);
   eina_log_print_cb_set(_edje_cc_log_cb, NULL);

   tmp_dir = getenv("TMPDIR");

   img_dirs = eina_list_append(img_dirs, ".");
   
   /* add defines to epp so edc files can detect edje_cc version */
   defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));

   for (i = 1; i < argc; i++)
     {
	if (!strcmp(argv[i], "-h"))
	  {
	     main_help();
	     exit(0);
	  }
	else if ((!strcmp(argv[i], "-V")) || (!strcmp(argv[i], "--version")))
	  {
	     printf("Version: %s\n", PACKAGE_VERSION);
	     exit(0);
	  }
	else if (!strcmp(argv[i], "-v"))
	  {
	     eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
	  }
	else if (!strcmp(argv[i], "-no-lossy"))
	  {
	     no_lossy = 1;
	  }
	else if (!strcmp(argv[i], "-no-comp"))
	  {
	     no_comp = 1;
          }
        else if (!strcmp(argv[i], "-no-raw"))
          {
             no_raw = 1;
          }
        else if (!strcmp(argv[i], "-no-etc1"))
          {
             no_etc1 = 1;
          }
        else if (!strcmp(argv[i], "-no-etc2"))
          {
             no_etc2 = 1;
          }
	else if (!strcmp(argv[i], "-no-save"))
	  {
	     no_save = 1;
	  }
	else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
	  {
	     i++;
	     img_dirs = eina_list_append(img_dirs, argv[i]);
	  }
	else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
	  {
	     i++;
	     fnt_dirs = eina_list_append(fnt_dirs, argv[i]);
	  }
        else if ((!strcmp(argv[i], "-sd") || !strcmp(argv[i], "--sound_dir")) && (i < (argc - 1)))
          {
             i++;
             snd_dirs = eina_list_append(snd_dirs, argv[i]);
          }
        else if ((!strcmp(argv[i], "-md") || !strcmp(argv[i], "--mo_dir")) && (i < (argc - 1)))
          {
             i++;
             mo_dirs = eina_list_append(mo_dirs, argv[i]);
          }
        else if ((!strcmp(argv[i], "-vd") || !strcmp(argv[i], "--vibration_dir")) && (i < (argc - 1)))
          {
             i++;
             vibration_dirs = eina_list_append(vibration_dirs, argv[i]);
          }
        else if ((!strcmp(argv[i], "-dd") || !strcmp(argv[i], "--data_dir")) && (i < (argc - 1)))
          {
             i++;
             data_dirs = eina_list_append(data_dirs, argv[i]);
          }
	else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
	  {
	     i++;
             if (!tmp_dir)
               tmp_dir = argv[i];
	  }
        else if ((!strcmp(argv[i], "-l") || !strcmp(argv[i], "--license")) && (i < (argc - 1)))
          {
             i++;
             if (!license)
               license = argv[i];
             else
               licenses = eina_list_append(licenses, argv[i]);
          }
        else if ((!strcmp(argv[i], "-a") || !strcmp(argv[i], "--authors")) && (i < (argc - 1)))
          {
             i++;
             if (!authors)
               authors = argv[i];
          }
	else if ((!strcmp(argv[i], "-min-quality")) && (i < (argc - 1)))
	  {
	     i++;
	     min_quality = atoi(argv[i]);
	     if (min_quality < 0) min_quality = 0;
	     if (min_quality > 100) min_quality = 100;
	  }
	else if ((!strcmp(argv[i], "-max-quality")) && (i < (argc - 1)))
	  {
	     i++;
	     max_quality = atoi(argv[i]);
	     if (max_quality < 0) max_quality = 0;
	     if (max_quality > 100) max_quality = 100;
	  }
	else if (!strcmp(argv[i], "-fastcomp"))
	  {
             compress_mode = EET_COMPRESSION_SUPERFAST;
	  }
	else if (!strcmp(argv[i], "-fastdecomp"))
	  {
             compress_mode = EET_COMPRESSION_VERYFAST;
	  }
	else if (!strcmp(argv[i], "-threads"))
	  {
             threads = 1;
	  }
	else if (!strcmp(argv[i], "-nothreads"))
	  {
             threads = 0;
	  }
	else if (!strncmp(argv[i], "-D", 2))
	  {
	     defines = eina_list_append(defines, mem_strdup(argv[i]));
	  }
	else if ((!strcmp(argv[i], "-o")) && (i < (argc - 1)))
	  {
	     i++;
	     file_out = argv[i];
	  }
	else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
	  {
             i++;
             watchfile = argv[i];
             unlink(watchfile);
	  }
	else if (!strcmp(argv[i], "-annotate"))
	  {
             annotate = 1;
          }
	else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
	  {
	     i++;
	     depfile = argv[i];
	     unlink(depfile);
	  }
	else if (!file_in)
	  file_in = argv[i];
	else if (!file_out)
	  file_out = argv[i];
     }

   if (!file_in)
     {
	ERR("no input file specified.");
	main_help();
	exit(-1);
     }

   pfx = eina_prefix_new(argv[0],            /* argv[0] value (optional) */
                         main,               /* an optional symbol to check path of */
                         "EDJE",             /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
                         "edje",             /* dir to add after "share" (PREFIX/share/DIRNAME) */
                         "include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
                         PACKAGE_BIN_DIR,    /* package bin dir @ compile time */
                         PACKAGE_LIB_DIR,    /* package lib dir @ compile time */
                         PACKAGE_DATA_DIR,   /* package data dir @ compile time */
                         PACKAGE_DATA_DIR    /* if locale needed  use LOCALE_DIR */
                        );

   /* check whether file_in exists */
#ifdef HAVE_REALPATH
   if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
#else
   if (stat(file_in, &st) || !S_ISREG(st.st_mode))
#endif
     {
	ERR("file not found: %s.", file_in);
	main_help();
	exit(-1);
     }

   if (!file_out)
      {
         char *suffix;

         if ((suffix = strstr(file_in,".edc")) && (suffix[4] == 0))
            {
               file_out = strdup(file_in);
               if (file_out)
                  {
                     suffix = strstr(file_out,".edc");
                     strcpy(suffix,".edj");
                  }
            }
      }
   if (!file_out)
     {
	ERR("no output file specified.");
	main_help();
	exit(-1);
     }

#ifdef HAVE_REALPATH
   if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
#else
   if (!strcmp (file_in, file_out))
#endif
     {
	ERR("input file equals output file.");
	main_help();
	exit(-1);
     }

   using_file(file_in, 'E');
   if (annotate) using_file(file_out, 'O');

   if (!edje_init())
     exit(-1);

   edje_file = mem_alloc(SZ(Edje_File));
   edje_file->compiler = strdup("edje_cc");
   edje_file->version = EDJE_FILE_VERSION;
   edje_file->minor = EDJE_FILE_MINOR;
   edje_file->feature_ver = 1; /* increment this every time we add a field
				* or feature to the edje file format that
				* does not load nicely as a NULL or 0 value
				* and needs a special fallback initialization
				*/
   edje_file->base_scale = FROM_INT(1);

   source_edd();
   source_fetch();

   data_setup();
   compile();
   reorder_parts();
   data_process_scripts();
   data_process_lookups();
   data_process_script_lookups();
   data_write();

   eina_prefix_free(pfx);
   pfx = NULL;
   
   edje_shutdown();
   eina_log_domain_unregister(_edje_cc_log_dom);
   eina_shutdown();

   return 0;
}
예제 #5
0
파일: efreetd.c 프로젝트: tasn/efl
int
main(int argc, char *argv[])
{
   char path[PATH_MAX + 128], buf[PATH_MAX];
   FILE *log;
   int fd;
   const char *log_file_dir = NULL;
   const char *hostname_str = NULL;

#ifdef HAVE_SYS_RESOURCE_H
   setpriority(PRIO_PROCESS, 0, 19);
#elif _WIN32
   SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
#endif

   if (!eina_init()) return 1;

   efreetd_mp_stat = eina_mempool_add("chained_mempool",
                                      "struct stat", NULL,
                                     sizeof(struct stat), 10);
   if (!efreetd_mp_stat) return 1;

   if (!ecore_init()) goto ecore_error;
   ecore_app_args_set(argc, (const char **)argv);
   if (!ecore_file_init()) goto ecore_file_error;
   if (!ipc_init()) goto ipc_error;
   if (!cache_init()) goto cache_error;

   log_file_dir = eina_environment_tmp_get();
   if (gethostname(buf, sizeof(buf)) < 0)
     hostname_str = "";
   else
     hostname_str = buf;
   snprintf(path, sizeof(path), "%s/efreetd_%s_XXXXXX.log",
            log_file_dir, hostname_str);
   fd = eina_file_mkstemp(path, NULL);
   if (fd < 0)
     {
        ERR("Can't create log file '%s'\b", path);
        goto tmp_error;
     }
   log = fdopen(fd, "wb");
   if (!log) goto tmp_error;
   eina_log_print_cb_set(eina_log_print_cb_file, log);
   efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
   if (efreetd_log_dom < 0)
     {
        EINA_LOG_ERR("Efreet: Could not create a log domain for efreetd.");
        goto tmp_error;
     }

   ecore_main_loop_begin();

   eina_mempool_del(efreetd_mp_stat);

   cache_shutdown();
   ipc_shutdown();
   ecore_file_shutdown();
   ecore_shutdown();
   eina_log_domain_unregister(efreetd_log_dom);
   efreetd_log_dom = -1;
   eina_shutdown();
   return 0;

tmp_error:
   cache_shutdown();
cache_error:
   ipc_shutdown();
ipc_error:
   ecore_file_shutdown();
ecore_file_error:
   ecore_shutdown();
ecore_error:
   if (efreetd_log_dom >= 0) eina_log_domain_unregister(efreetd_log_dom);
   efreetd_log_dom = -1;
   eina_shutdown();
   return 1;
}
예제 #6
0
파일: efreetd.c 프로젝트: jigpu/efl
int
main(int argc, char *argv[])
{
   char path[PATH_MAX];
   FILE *log;

   strcpy(path, "/tmp/efreetd_XXXXXX");
   if (mkstemp(path) < 0)
     {
        perror("mkstemp");
        return 1;
     }
   if (chmod(path, 0700) < 0)
     {
        perror("chmod");
        return 1;
     }

   log = fopen(path, "wb");
   if (!log) return 1;

   if (!eina_init()) return 1;
   eina_log_print_cb_set(eina_log_print_cb_file, log);

   efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
   if (efreetd_log_dom < 0)
     {
        EINA_LOG_ERR("Efreet: Could not create a log domain for efreetd.");
        goto ecore_error;
     }
   if (!ecore_init()) goto ecore_error;
   ecore_app_args_set(argc, (const char **)argv);
   if (!ecore_file_init()) goto ecore_file_error;

   if (!dbus_init()) goto dbus_error;
   if (!cache_init()) goto cache_error;

#ifdef HAVE_SYS_RESOURCE_H
   setpriority(PRIO_PROCESS, 0, 19);
#elif _WIN32
    SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
#endif

   ecore_main_loop_begin();

   cache_shutdown();
   dbus_shutdown();
   ecore_file_shutdown();
   ecore_shutdown();
   eina_log_domain_unregister(efreetd_log_dom);
   efreetd_log_dom = -1;
   eina_shutdown();
   return 0;

cache_error:
   dbus_shutdown();
dbus_error:
   ecore_file_shutdown();
ecore_file_error:
   ecore_shutdown();
ecore_error:
   if (efreetd_log_dom >= 0)
     eina_log_domain_unregister(efreetd_log_dom);
   efreetd_log_dom = -1;
   eina_shutdown();
   return 1;
}