annotate Gui/win32/gui.h @ 21140:b42f1c1ef651

Make compilation depending on USE_SUB unconditional. USE_SUB was hardcoded to true in configure, manually turning it off would break compilation, and there's no apparent reason why having all subtitle code under #ifdefs (even working ones) would be worth the clutter.
author uau
date Tue, 21 Nov 2006 20:48:17 +0000
parents d450ec82ae57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18914
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
1 /*
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
2 MPlayer Gui for win32
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
3 Copyright (c) 2003 Sascha Sommer <saschasommer@freenet.de>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
4 Copyright (c) 2006 Erik Augustson <erik_27can@yahoo.com>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
5 Copyright (c) 2006 Gianluigi Tiesi <sherpya@netfarm.it>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
6
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
9 the Free Software Foundation; either version 2 of the License, or
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
10 (at your option) any later version.
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
11
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
12 This program is distributed in the hope that it will be useful,
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
15 GNU General Public License for more details.
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
16
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
18 along with this program; if not, write to the Free Software
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
20 */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
21
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
22 #ifndef _GUI_H
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
23 #define _GUI_H
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
24 #include <config.h>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
25 #include <playtree.h>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
26 #include <m_config.h>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
27 #include "skinload.h"
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
28 #include "playlist.h"
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
29
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
30 extern char *skinName;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
31 extern float sub_aspect;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
32 extern play_tree_t* playtree;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
33 extern m_config_t* mconfig;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
34
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
35 extern NOTIFYICONDATA nid;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
36
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
37 typedef struct window_priv_t window_priv_t;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
38 struct window_priv_t
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
39 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
40 HWND hwnd;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
41 image img;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
42 image *background;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
43 HBITMAP bitmap;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
44 int type;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
45 };
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
46
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
47 typedef struct gui_t gui_t;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
48 struct gui_t
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
49 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
50 /* screenproperties */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
51 int screenw, screenh, screenbpp;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
52 /* window related stuff */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
53 char *classname;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
54 HICON icon;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
55 unsigned int window_priv_count;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
56 window_priv_t **window_priv;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
57
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
58 HWND mainwindow;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
59 HWND subwindow;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
60
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
61 /* for event handling */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
62 widget *activewidget;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
63
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
64 int mousewx, mousewy; /* mousepos inside widget */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
65 int mousex, mousey;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
66
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
67 HMENU menu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
68 HMENU diskmenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
69 HMENU traymenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
70 HMENU trayplaymenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
71 HMENU trayplaybackmenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
72 HMENU submenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
73 HMENU subtitlemenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
74 HMENU aspectmenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
75 HMENU dvdmenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
76 HMENU playlistmenu;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
77
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
78 int skinbrowserwindow;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
79 int playlistwindow;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
80 int aboutwindow;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
81
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
82 skin_t *skin;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
83 playlist_t *playlist;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
84
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
85 void (*startplay)(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
86 void (*updatedisplay)(gui_t *gui, HWND hwnd);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
87 void (*playercontrol)(int event); /* userdefine call back function */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
88 void (*uninit)(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
89 };
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
90
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
91 #define wsShowWindow 8
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
92 #define wsHideWindow 16
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
93 #define wsShowFrame 1
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
94 #define wsMovable 2
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
95 #define wsSizeable 4
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
96
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
97 extern gui_t *create_gui(char *skindir, char *skinName, void (*playercontrol)(int event));
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
98 extern int destroy_window(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
99 extern int create_window(gui_t *gui, char *skindir);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
100 extern int create_subwindow(gui_t *gui, char *skindir);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
101 extern int parse_filename(char *file, play_tree_t *playtree, m_config_t *mconfig, int clear);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
102 extern void capitalize(char *filename);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
103 extern int import_playtree_playlist_into_gui(play_tree_t *my_playtree, m_config_t *config);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
104
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
105 /* Dialogs */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
106 extern void display_playlistwindow(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
107 extern void update_playlistwindow(void);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
108 extern int display_openfilewindow(gui_t *gui, int add);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
109 extern void display_openurlwindow(gui_t *gui, int add);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
110 extern void display_skinbrowser(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
111 extern void display_chapterselwindow(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
112 extern void display_eqwindow(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
113 extern void display_prefswindow(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
114 extern void display_opensubtitlewindow(gui_t *gui);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
115
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
116 #endif