common.h 3.16 KB
Newer Older
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
1
/*****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
2
 * Copyright © 2015-2016 VideoLAN, VideoLabs SAS
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *****************************************************************************
 *
 * Authors: Nicolas Rechatin [nicolas@videolabs.io]
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
/*
 * By committing to this project, you allow VideoLAN and VideoLabs to relicense
 * the code to a different OSI approved license, in case it is required for
 * compatibility with the Store
 *****************************************************************************/

#ifndef __vlc_common_H__
#define __vlc_common_H__

30 31 32
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
33 34 35

#include <stdio.h>
#include <stdlib.h>
36 37

#include <tizen.h>
38
#include <app_common.h>
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
39
#include <dlog.h>
40
#include "compat.h"
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
41 42 43 44

#ifdef  LOG_TAG
# undef  LOG_TAG
#endif
45
#define LOG_TAG "vlc"
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
46

Thomas Guillem's avatar
Thomas Guillem committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#undef LOGD
#undef LOGI
#undef LOGW
#undef LOGE
#undef LOGF
#ifdef _DEBUG
#define LOGD(...)  dlog_print(DLOG_DEBUG, LOG_TAG, __VA_ARGS__)
#else
#define LOGD(...)
#endif
#define LOGI(...)  dlog_print(DLOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGW(...)  dlog_print(DLOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGE(...)  dlog_print(DLOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGF(...)  dlog_print(DLOG_FATAL, LOG_TAG, __VA_ARGS__)


Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
63 64 65 66
#if !defined(PACKAGE)
# define PACKAGE "org.videolan.vlc"
#endif

67
#define EDJPATH "edje"
68 69
#define ICONPATH "icon"
#define IMAGESPATH "images"
70 71 72
#define VIDEOPLAYER_EDJ get_resource_path( EDJPATH "/video_player.edj")
#define AUDIOPLAYERMINI_EDJ get_resource_path( EDJPATH "/audio_player_mini.edj")
#define AUDIOPLAYER_EDJ get_resource_path( EDJPATH "/audio_player.edj")
73
#define AUDIOPLAYERSPEED_EDJ get_resource_path( EDJPATH "/audio_player_speed.edj")
74
#define QUICKPANELCONTROLS_EDJ get_resource_path( EDJPATH "/quick_panel_controls.edj")
75 76
#define ABOUT_EDJ get_resource_path( EDJPATH "/about.edj")
#define THEME_EDJ get_resource_path( EDJPATH "/theme.edj")
77

78 79
#define RES_DIR "/opt/usr/apps/" PACKAGE "/res/"
#define ICON_DIR RES_DIR "/images/"
80

81 82
#include <Evas.h>

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
#define MAX_LENGTH_PATH 1024
static inline const char *get_resource_path(const char *file_path)
{
    static char absolute_path[MAX_LENGTH_PATH] = {'\0'};

    static char *res_path_buff = NULL;
    if(res_path_buff == NULL)
    {
        res_path_buff = app_get_resource_path();
    }

    snprintf(absolute_path, MAX_LENGTH_PATH, "%s%s", res_path_buff, file_path);

    return absolute_path;
}
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
98
#endif /* __vlc_common_H__ */