1 /* 2 * Copyright 2007 Simone Della Longa <simonedll@yahoo.it> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #ifndef _MYFRAME_H 20 #define _MYFRAME_H 21 #include "settingsDialog.h" 22 #include "launcher_dialog.h" 23 24 25 /* Forward declaration */ 26 class SettingsDialog; 27 28 29 class MyFrame:public wxFrame 30 { 31 32 public: 33 MyFrame (wxWindow * parent,simSettings* ss, ImagesArray* array, wxWindowID id, const wxString & title, 34 const wxPoint & pos = wxDefaultPosition, const wxSize & size = 35 wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE); 36 wxPoint lastPosition; //Last position on-screen before being destroyed 37 void SetWallpaper (wxBitmap * newBitmap); 38 wxBitmap * GetWallpaper (); 39 void requestAttention(simImage* img); 40 41 42 void SetBG (wxImage * newImg); 43 wxImage * GetBG (); 44 45 void SetMarkBitmap (wxBitmap * newBmp); 46 wxBitmap * GetMarkBitmap (); 47 48 49 void updateSize(); 50 bool disposed; 51 /* Auto-hide feature */ 52 int frameOptions; 53 wxSize appSize; 54 private: 55 void RefreshSizes (simImage * img, int distance); 56 /* Mouse */ 57 void OnMiddleDown (wxMouseEvent & event); 58 void OnMiddleUp (wxMouseEvent & event); 59 void OnMouseMove (wxMouseEvent & event); 60 void OnMouseLeave (wxMouseEvent & event); 61 void OnMouseEnter (wxMouseEvent & event); 62 void OnLeftUp (wxMouseEvent & event); 63 void OnLeftDown(wxMouseEvent& event); 64 void OnRightClick (wxMouseEvent & event); 65 66 void OnContextMenu (wxContextMenuEvent & event); 67 void OnKeyDown (wxKeyEvent & event); 68 69 void OnFrameMove (wxMoveEvent & event); 70 void OnPaint (wxPaintEvent & event); 71 void OnBackground (wxEraseEvent & event); 72 void OnBlurTimerTick (wxTimerEvent & event); 73 /* Menu callbacks */ 74 void OnQuit (wxCommandEvent & event); 75 void OnAbout (wxCommandEvent & event); 76 void OnSettings(wxCommandEvent & event); 77 void OnAdd (wxCommandEvent & event); 78 void OnEdit (wxCommandEvent &event); 79 void OnDelete (wxCommandEvent &event); 80 void OnWindowClose(wxCommandEvent &event); 81 82 /* popUp menu */ 83 wxMenu *popMenu; 84 85 wxAboutDialogInfo* info; //About informations 86 87 wxMenuItem* EditMenuItem; 88 wxMenuItem* DeleteMenuItem; 89 wxMenuItem* CloseMenuItem; 90 int clickedID; //-1 means no launcher clicked 91 92 /* Icons Drag n drop */ 93 bool dragging; 94 int draggedID; 95 wxPoint draggedPos; 96 97 simSettings* settings; 98 ImagesArray* ImagesList; 99 100 wxTimer * blurTimer; 101 102 wxImage * appBackground; //Simdock background 103 wxMemoryDC * src_dc; //Device context used to draw the wallpaper 104 wxBitmap * backImage; //DE wallpaper 105 wxBitmap* markBitmap; 106 107 108 bool middleClicked; 109 wxPoint middleClick; 110 111 SettingsDialog *settingsDialog; 112 void OnClose (wxCloseEvent & event); 113 114 DECLARE_EVENT_TABLE () 115 116 }; 117 118 #endif /* _MYFRAME_H */ 119