forked from enlightenment/ephoto
whitespace cleanup, log domain to lowercase.
SVN revision: 53200
This commit is contained in:
parent
844d8b6529
commit
2e88dacb27
156
src/bin/ephoto.c
156
src/bin/ephoto.c
|
@ -5,101 +5,101 @@ static void _ephoto_display_usage(void);
|
||||||
/* Global log domain pointer */
|
/* Global log domain pointer */
|
||||||
int __log_domain = -1;
|
int __log_domain = -1;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Ethumb_Client *client;
|
Ethumb_Client *client;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
elm_need_efreet();
|
elm_need_efreet();
|
||||||
elm_need_ethumb();
|
elm_need_ethumb();
|
||||||
elm_init(argc, argv);
|
elm_init(argc, argv);
|
||||||
|
|
||||||
if (!efreet_mime_init())
|
if (!efreet_mime_init())
|
||||||
fprintf(stderr, "Could not init efreet_mime!\n");
|
fprintf(stderr, "Could not init efreet_mime!\n");
|
||||||
|
|
||||||
client = elm_thumb_ethumb_client_get();
|
client = elm_thumb_ethumb_client_get();
|
||||||
if (!client)
|
if (!client)
|
||||||
{
|
{
|
||||||
ERR("could not get ethumb_client");
|
ERR("could not get ethumb_client");
|
||||||
r = 1;
|
r = 1;
|
||||||
goto end_log_domain;
|
goto end_log_domain;
|
||||||
}
|
}
|
||||||
ethumb_client_size_set(client, 100, 100);
|
ethumb_client_size_set(client, 100, 100);
|
||||||
ethumb_client_crop_align_set(client, 0.5, 0.5);
|
ethumb_client_crop_align_set(client, 0.5, 0.5);
|
||||||
ethumb_client_aspect_set(client, ETHUMB_THUMB_KEEP_ASPECT);
|
ethumb_client_aspect_set(client, ETHUMB_THUMB_KEEP_ASPECT);
|
||||||
ethumb_client_orientation_set(client, ETHUMB_THUMB_ORIENT_ORIGINAL);
|
ethumb_client_orientation_set(client, ETHUMB_THUMB_ORIENT_ORIGINAL);
|
||||||
__log_domain = eina_log_domain_register("Ephoto", EINA_COLOR_BLUE);
|
__log_domain = eina_log_domain_register("ephoto", EINA_COLOR_BLUE);
|
||||||
if (!__log_domain)
|
if (!__log_domain)
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Could not register log domain: Ephoto");
|
EINA_LOG_ERR("Could not register log domain: Ephoto");
|
||||||
r = 1;
|
r = 1;
|
||||||
goto end_log_domain;
|
goto end_log_domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DBG("Logging initialized");
|
DBG("Logging initialized");
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
{
|
{
|
||||||
printf("Too Many Arguments!\n");
|
printf("Too Many Arguments!\n");
|
||||||
_ephoto_display_usage();
|
_ephoto_display_usage();
|
||||||
r = 1;
|
r = 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if (argc < 2)
|
else if (argc < 2)
|
||||||
{
|
{
|
||||||
ephoto_create_main_window(NULL, NULL);
|
ephoto_create_main_window(NULL, NULL);
|
||||||
}
|
}
|
||||||
else if (!strncmp(argv[1], "--help", 6))
|
else if (!strncmp(argv[1], "--help", 6))
|
||||||
{
|
{
|
||||||
_ephoto_display_usage();
|
_ephoto_display_usage();
|
||||||
r = 0;
|
r = 0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if (ecore_file_is_dir(argv[1]))
|
else if (ecore_file_is_dir(argv[1]))
|
||||||
{
|
{
|
||||||
char *real = ecore_file_realpath(argv[1]);
|
char *real = ecore_file_realpath(argv[1]);
|
||||||
ephoto_create_main_window(real, NULL);
|
ephoto_create_main_window(real, NULL);
|
||||||
free(real);
|
free(real);
|
||||||
}
|
}
|
||||||
else if (ecore_file_exists(argv[1]))
|
else if (ecore_file_exists(argv[1]))
|
||||||
{
|
{
|
||||||
char *directory, *real;
|
char *directory, *real;
|
||||||
const char *image;
|
const char *image;
|
||||||
|
|
||||||
image = eina_stringshare_add(argv[1]);
|
image = eina_stringshare_add(argv[1]);
|
||||||
directory = ecore_file_dir_get(argv[1]);
|
directory = ecore_file_dir_get(argv[1]);
|
||||||
real = ecore_file_realpath(directory);
|
real = ecore_file_realpath(directory);
|
||||||
ephoto_create_main_window(real, image);
|
ephoto_create_main_window(real, image);
|
||||||
free(directory);
|
free(directory);
|
||||||
free(real);
|
free(real);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Incorrect Argument!\n");
|
printf("Incorrect Argument!\n");
|
||||||
_ephoto_display_usage();
|
_ephoto_display_usage();
|
||||||
r = 1;
|
r = 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_run();
|
elm_run();
|
||||||
|
|
||||||
end:
|
end:
|
||||||
eina_log_domain_unregister(__log_domain);
|
eina_log_domain_unregister(__log_domain);
|
||||||
end_log_domain:
|
end_log_domain:
|
||||||
efreet_mime_shutdown();
|
efreet_mime_shutdown();
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Display useage commands for ephoto*/
|
/*Display useage commands for ephoto*/
|
||||||
static void
|
static void
|
||||||
_ephoto_display_usage(void)
|
_ephoto_display_usage(void)
|
||||||
{
|
{
|
||||||
printf("Ephoto Useage: \n"
|
printf("Ephoto Useage: \n"
|
||||||
"ephoto --help : This page\n"
|
"ephoto --help : This page\n"
|
||||||
"ephoto filename : Specifies a file to open\n"
|
"ephoto filename : Specifies a file to open\n"
|
||||||
"ephoto dirname : Specifies a directory to open\n");
|
"ephoto dirname : Specifies a directory to open\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue