legacy/experimental/ecdb/trunk/src/ecdb.c

190 lines
3.7 KiB
C
Raw Normal View History

#include "ecdb.h"
2008-04-07 01:04:15 +00:00
/* Global Variables */
int ECDB_DRIVE_ACTION_FINISHED = 0;
int ECDB_DRIVE_ACTION_BEGUN = 0;
int ECDB_DRIVE_ACTION_UPDATE = 0;
Ecdb_Main *em;
int ecdb_setup();
int
main(int argc, char **argv)
{
2008-12-09 05:47:59 +00:00
int ret = 0;
/* Do I really need all of these? */
if (!ecore_init())
{
printf("Cannot initialize Ecore!\n");
return 1;
}
if (!ecore_string_init())
{
printf("Cannot initialize Ecore_String!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecore_file_init())
{
printf("Cannot initialize Ecore_File!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecore_evas_init())
{
printf("Cannot initialize Ecore_Evas!\n");
ret = 1;
goto SHUTDOWN;
}
if (!edje_init())
{
printf("Cannot initialize Edje!\n");
ret = 1;
goto SHUTDOWN;
}
if (!efreet_init())
{
printf("Cannot initialize Efreet!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ewl_init(&argc, argv))
{
printf("Connot initialize Ewl!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecdb_image_init())
{
printf("Cannot initialize libisofs!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecdb_burn_init())
{
printf("Cannot initialize libburn!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecdb_setup())
{
printf("Setup failed\n");
ret = 1;
goto SHUTDOWN;
}
ecdb_print_drive_info();
if (!ecdb_create_main_gui())
{
printf("Cannot create main window\n");
ret = 1;
goto SHUTDOWN;
}
/*
Ecdb_Audio_Project *proj;
Ecdb_Source *src;
proj = ecdb_audio_project_new();
i = 1;
while ((i < argc) && (argv))
{
if (ecore_file_exists(argv[i]))
{
if (!ecore_file_is_dir(argv[i]))
{
src = ecdb_source_new();
ecdb_source_data_set(src, argv[i], 0);
ecdb_source_child_append(proj->tracks, src);
}
}
i++;
}
ecdb_audio_project_start(proj);
proj->publisher_id = proj->data_preparer_id = proj->system_id =
proj->application_id = proj->copywrite_id =
proj->abstract_id = proj->biblio_id = strdup("ecdb");
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), 0))
{
printf("Couldn't grab drive!\n");
ret = 1;
goto SHUTDOWN;
}
if (!ecdb_burn_project(proj))
{
printf("Burn was unsuccessful\n");
ret = 1;
goto SHUTDOWN;
}
*/
ewl_main();
/* End testing */
2008-04-07 20:40:30 +00:00
SHUTDOWN:
2008-12-09 05:47:59 +00:00
burn_finish();
iso_finish();
ewl_shutdown();
ecore_file_shutdown();
ecore_string_shutdown();
ecore_evas_shutdown();
ecore_shutdown();
edje_shutdown();
efreet_shutdown();
printf("Program Done\n");
return ret;
};
int
ecdb_setup(void)
{
2008-12-09 05:47:59 +00:00
em = NULL;
em = calloc(1, sizeof(Ecdb_Main));
em->drives = NULL;
em->drop_object = NULL;
em->dnd_candidates = ecore_list_new();
if (!ecore_file_mkdir("/tmp/ecdb"))
{
printf("Creation of temporary directory failed!\n");
}
ECDB_DRIVE_ACTION_FINISHED = ecore_event_type_new();
ECDB_DRIVE_ACTION_BEGUN = ecore_event_type_new();
ECDB_DRIVE_ACTION_UPDATE = ecore_event_type_new();
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown, NULL);
ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION, ecdb_dnd_position, em);
ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP, ecdb_dnd_drop, em);
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, ecdb_dnd_selection,
em);
if (!ecdb_aquire_drive_info())
{
printf("Aquiring drives failed!\n");
return FALSE;
}
return TRUE;
}