camelot.cpp File Reference

(r1785/r1771)

Go to the source code of this file.

Classes

class  CamIPCServer
class  CMediaReplayDetect

Functions

static bool GiveFocusToFocusableOffspring (wxWindow *pWnd)
wxIPCFormat WXUNUSED (format))
static void Use (void *)
 This function runs a false "main" loop, doing exit clean up etc. where possible - See CCamApp::OnFatalException() for how it works.
static void FillMediaAppMap (SelMediaDlgParam::CMediaAppList *pMapMediaApp)

Variables

 size
wxChar m_pBuffer [4096]
static const wxCmdLineEntryDesc cmdLineDesc []
long type = wxDEFAULT_FRAME_STYLE
long const wxString & name
static PCTSTR g_apszApps []
 Retrieve a map of media replay applications.


Function Documentation

static void FillMediaAppMap SelMediaDlgParam::CMediaAppList pMapMediaApp  )  [static, private]
 

Definition at line 2840 of file camelot.cpp.

02841 {
02842     // Add the basic list of applications
02843     bool                fControlable = true;
02844     UINT32              ord = 0;
02845     while( NULL != g_apszApps[ord] )
02846     {
02847         // Skip controlable marker
02848         if( PCTSTR(1) == g_apszApps[ord] )
02849         {
02850             ++ord;
02851             fControlable = false;
02852             continue;
02853         }
02854 
02855         pMapMediaApp->insert( std::make_pair( g_apszApps[ord], fControlable ) );
02856         ++ord;
02857     }
02858 
02859     // Remove any non-present apps
02860     CMediaReplayDetect  Detect;
02861     SelMediaDlgParam::CMediaAppListIter end( pMapMediaApp->end() );
02862     SelMediaDlgParam::CMediaAppListIter iter( pMapMediaApp->begin() );
02863     for( ; iter != end; )
02864     {
02865         SelMediaDlgParam::CMediaAppListIter iterCur( iter++ ); 
02866         if( !Detect.IsAppPresent( iterCur->first ) )
02867         {
02868             TRACEUSER( "luke", _T("%s is not present"), (PCTSTR)iterCur->first );
02869              pMapMediaApp->erase( iterCur->first );
02870         }
02871     }
02872 }

static bool GiveFocusToFocusableOffspring wxWindow *  pWnd  )  [static]
 

Definition at line 464 of file camelot.cpp.

00465 {
00466     TRACEUSER( "jlh92", _T("GF2FO class %s\n"), pWnd->GetClassInfo()->GetClassName() );
00467 
00468     // Can we give focus to passed window. Yes, give focus
00469     // and return happy
00470     if( pWnd->AcceptsFocus() )
00471     {
00472         TRACEUSER( "jlh92", _T("Focused!\n") );
00473         pWnd->SetFocus();
00474         return true;
00475     }
00476 
00477     // No, lets try the children then
00478     wxWindowList&       lstChild = pWnd->GetChildren();
00479     wxWindowListNode*   pNode = lstChild.GetFirst();
00480     while( NULL != pNode )
00481     {
00482         if( GiveFocusToFocusableOffspring( pNode->GetData() ) )
00483             return true;
00484 
00485         pNode = pNode->GetNext();
00486     }
00487     
00488     return false;
00489 }

static void Use void *   )  [inline, static, private]
 

This function runs a false "main" loop, doing exit clean up etc. where possible - See CCamApp::OnFatalException() for how it works.

Author:
Alex Bligh <alex@alex.org.uk>
Date:
09/05/06
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: Public

See also:
-
We assume that app initialization has already been done, or we wouldn't have been installed as the exception handler. So we don't do it again. Note we return from this (so the OnExit() stuff gets called), but that the caller should then exit() immediately.

Definition at line 2736 of file camelot.cpp.

02736 {}

wxIPCFormat WXUNUSED format   ) 
 

Definition at line 508 of file camelot.cpp.

00509     {
00510         // argv buffer
00511         INT32 argc = 0;
00512 
00513         INT32 i;
00514         for (i=0; i<size; i++)
00515         {
00516             // exit if this is a NULL, and the last character was a NULL
00517             if (!data[i] && i && !data[i-1])
00518                 break;
00519 
00520             if (!data[i])
00521                 argc++;
00522         }
00523 
00524         wxChar ** argv = new wxChar*[argc];
00525 
00526         wxChar* p = data;
00527         for (i=0; i<argc; i++)
00528         {
00529             argv[i] = camStrdup(p);
00530             p+=wxStrlen(argv[i])+1; // move past null
00531         }
00532 
00533         BOOL result = wxGetApp().OnSecondInstance(argv, argc);
00534 
00535         // free memory
00536         for (i=0; i<argc; i++)
00537         {
00538             free(argv[i]);
00539         }
00540         delete [] argv;
00541 
00542         // return
00543         return result;
00544     }


Variable Documentation

const wxCmdLineEntryDesc cmdLineDesc[] [static]
 

Initial value:

{





    { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("Display this help"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
    { wxCMD_LINE_SWITCH, _T("v"), _T("version"),    _T("Display the version information") },
    { wxCMD_LINE_OPTION, _T("r"), _T("resource"),   _T("resource directory") },
    { wxCMD_LINE_SWITCH, _T("x"), _T("xrccheckgen"), _T("generate xrc.check file") },
    { wxCMD_LINE_PARAM, NULL, NULL, _T("input file"), wxCMD_LINE_VAL_STRING, 
                                        wxCMD_LINE_PARAM_OPTIONAL|wxCMD_LINE_PARAM_MULTIPLE },
    { wxCMD_LINE_NONE }
}

Definition at line 564 of file camelot.cpp.

PCTSTR g_apszApps[] [static]
 

Initial value:

 {_T("mplayer"),
                                        _T("gmplayer"),
                                        PCTSTR(1),              
                                        _T("gxine"),
                                        _T("xine"),
                                        _T("totem"),
                                        _T("xfmedia"),
                                        _T("codeine"),
                                        NULL }
Retrieve a map of media replay applications.

Author:
Luke_Hart (Xara Group Ltd) <camelotdev@xara.com> <luke.hartΩxara.com>
Date:
23/08/06
Parameters:
pMapMediaApp - A map to contain all the media apps avaiable on system [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: Public

See also:
-

Definition at line 2830 of file camelot.cpp.

wxChar m_pBuffer[4096]
 

Definition at line 547 of file camelot.cpp.

long const wxString& name
 

Initial value:

 wxT("frame"))
        : wxDocMDIChildFrame(doc,view,frame,id,title,pos,size,type,name)
    { }

    virtual bool Destroy()
    { 





        return wxDocMDIChildFrame::Destroy(); 
    }
}

Definition at line 1818 of file camelot.cpp.

size
 

/

Initialisation.

const wxString camIPC_START = _T("StartOther");

class CamIPCConnection : public wxConnection {

public: CamIPCConnection() : wxConnection(m_pBuffer, WXSIZEOF(m_pBuffer)) {}

virtual bool OnExecute (const wxString& WXUNUSED(topic), wxChar *data, int /* TYPENOTE: Correct

Definition at line 507 of file camelot.cpp.

long type = wxDEFAULT_FRAME_STYLE
 

/

The following is class is needed to ensure that the file menu is removed from the file histroy menu list.

class CCamDocMDIChildFrame : public wxDocMDIChildFrame { public : CCamDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, /* TYPENOTE: Correct

Definition at line 1818 of file camelot.cpp.


Generated on Sat Nov 10 03:49:27 2007 for Camelot by  doxygen 1.4.4