Mercurial > mplayer.hg
diff gui/app/app.h @ 35525:e27855a45128
Rebuild GUI directory structure.
Create new directory app/ and
move app.*, cfg.* and gui.h to app/.
author | ib |
---|---|
date | Thu, 06 Dec 2012 13:47:47 +0000 |
parents | gui/app.h@13ae955b6eae |
children | f2093dc82b5f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/app/app.h Thu Dec 06 13:47:47 2012 +0000 @@ -0,0 +1,183 @@ +/* + * This file is part of MPlayer. + * + * MPlayer 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. + * + * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_GUI_APP_H +#define MPLAYER_GUI_APP_H + +#include "gui/util/bitmap.h" +#include "gui/wm/ws.h" + +/// GUI messages (user events) +enum { + evNone, + evPlay, + evStop, + evPause, + evPrev, + evNext, + evLoad, + evLoadPlay, + evLoadAudioFile, + evLoadSubtitle, + evDropSubtitle, + evPlaylist, + evPlayCD, + evPlayVCD, + evPlayDVD, + evLoadURL, + evPlaySwitchToPause, + evPauseSwitchToPlay, + evBackward10sec, + evForward10sec, + evBackward1min, + evForward1min, + evBackward10min, + evForward10min, + evSetMoviePosition, + evHalfSize, + evDoubleSize, + evFullScreen, + evNormalSize, + evSetAspect, + evIncVolume, + evDecVolume, + evSetVolume, + evMute, + evSetBalance, + evEqualizer, + evAbout, + evPreferences, + evSkinBrowser, + evMenu, + evIconify, + evExit = 100 +}; + +/// Internal messages (events) +enum { + ivSetVideo = 1000, + ivSetAudio, + ivSetSubtitle, + ivSetCDTrack, + ivSetVCDTrack, + ivSetDVDTitle, + ivSetDVDChapter, + ivSetDVDAudio, + ivSetDVDSubtitle, + ivPlayDVD, + ivShowPopUpMenu, + ivHidePopUpMenu, + ivRedraw +}; + +typedef struct { + int message; + const char *name; +} evName; + +/// Skin items +enum { + itNone, + itBase, + itButton, + itSLabel, + itDLabel, + itHPotmeter, + itVPotmeter, + itPotmeter, + itMenu, + itPLMButton = 100, + itPRMButton +}; + +//@{ +/// Button state +#define btnDisabled 0 +#define btnReleased 1 +#define btnPressed 2 +//@} + +/// Item definition +typedef struct { + int type; + + int x, y; + int width, height; + + guiImage Bitmap; + guiImage Mask; + + int fontid; + int align; + char *label; + + int pwidth, pheight; + int numphases; + float value; + + int message; + + int R, G, B; + + char *text; + int textwidth; + unsigned int starttime; + int last_x; + + int pressed; +} wItem; + +/// Maximum GUI items +#define MAX_ITEMS 64 + +typedef struct { + wItem main; + wsTWindow mainWindow; + int mainDecoration; + + wItem video; + wsTWindow videoWindow; + + wItem playbar; + wsTWindow playbarWindow; + int playbarIsPresent; + + wItem menu; + wItem menuSelected; + wsTWindow menuWindow; + int menuIsPresent; + + int IndexOfMainItems; + wItem mainItems[MAX_ITEMS]; + + int IndexOfPlaybarItems; + wItem playbarItems[MAX_ITEMS]; + + int IndexOfMenuItems; + wItem menuItems[MAX_ITEMS]; +} guiItems; + +extern guiItems guiApp; + +wItem *appFindItem(int event); +int appFindMessage(const char *name); +void appFreeStruct(void); +void btnModify(int event, float state); +void btnSet(int event, int set); + +#endif /* MPLAYER_GUI_APP_H */