vlcplugin_gtk.h 2.3 KB
Newer Older
1
/*****************************************************************************
2
 * vlcplugin_gtk.h: a VLC plugin for Mozilla (GTK+ interface)
3
 *****************************************************************************
4
 * Copyright (C) 2012 VLC authors and VideoLAN
5 6
 * $Id$
 *
7
 * Authors: Cheng Sun <chengsun9@gmail.com>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *
 * 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.
 *****************************************************************************/

#ifndef __VLCPLUGIN_GTK_H__
#define __VLCPLUGIN_GTK_H__

#include "vlcplugin_base.h"

#include <gtk/gtk.h>
30
#include <X11/Xlib.h>
31

32 33
#define VLCPLUGINGTK_MENU_TOOLBAR "Show toolbar"

34 35 36 37 38 39 40 41 42 43
class VlcPluginGtk : public VlcPluginBase
{
public:
    VlcPluginGtk(NPP, NPuint16_t);
    virtual ~VlcPluginGtk();

    bool create_windows();
    bool resize_windows();
    bool destroy_windows();

44 45 46 47 48 49 50
    void toggle_fullscreen();
    void set_fullscreen(int);
    int get_fullscreen();
    void do_set_fullscreen(bool);

    void set_toolbar_visible(bool);
    bool get_toolbar_visible();
51
    void update_controls();
52 53
    void popup_menu();

54
    void resize_video_xwindow(GdkRectangle *rect);
55 56

    GdkPixbuf *cone_icon;
57 58
    GtkWidget *time_slider, *vol_slider;
    guint time_slider_timeout_id, vol_slider_timeout_id;
59 60
private:
    void set_player_window();
61
    Display *get_display() { return display; }
62 63

    unsigned int     i_width, i_height;
64 65
    GtkWidget *parent, *parent_vbox, *video_container;
    GtkWidget *fullscreen_win;
66
    GtkWidget *toolbar;
67 68
    gulong video_container_size_handler_id;

69
    Display *display;
70
    Window video_xwindow;
71
    XColor bg_color;
72
    bool is_fullscreen, is_toolbar_visible;
73 74 75
};

#endif /* __VLCPLUGIN_GTK_H__ */