コード例 #1
0
ファイル: MainFrame.cpp プロジェクト: LawnGnome/dubnium
// {{{ MainFrame::MainFrame()
MainFrame::MainFrame() : wxFrame(NULL, ID_MAINFRAME, _("Dubnium")) {
	config = wxConfigBase::Get();

	server = new DBGp::Server(static_cast<wxUint16>(config->Read(wxT("Network/Port"), 9000)), this);

	wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);

	sizer->Add(notebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON | wxAUI_NB_CLOSE_ON_ALL_TABS), 1, wxEXPAND | wxALL);

	notebook->AddPage(new WelcomePage(notebook), _("Welcome"));
#ifdef __WXDEBUG__
	notebook->AddPage(new DebugPage(notebook), _("Debug Log"));
#endif

	SetMenuBar(CreateMenuBar());
	SetAutoLayout(true);
	SetSizer(sizer);
	sizer->SetSizeHints(this);

#ifndef __WXMAC__
	wxIcon icon;
	icon.CopyFromBitmap(wxArtProvider::GetBitmap(wxT("icon"), wxART_TOOLBAR, wxSize(32, 32)));
	SetIcon(icon);
#endif

	LoadSize();
}
コード例 #2
0
static TString* LoadString (LoadState* S)
{
 size_t size=LoadSize(S);
 if (size==0)
  return NULL;
 else
 {
  char* s=luaZ_openspace(S->L,S->b,size);
  ezread(S,s,size);
  return luaS_newlstr(S->L,s,size-1);        /* remove trailing '\0' */
 }
}
コード例 #3
0
ファイル: lundump.c プロジェクト: gitrider/wxsj2
static TString* LoadWString (LoadState* S)
{
 size_t size=LoadSize(S);
 if (size==0)
  return NULL;
 else
 {
  lua_WChar* s=(lua_WChar *)luaZ_openspace(S->L,S->b,size*2);
  ezread(S,s,size*2);
  return luaS_newlwstr(S->L,(const lua_WChar*)s,size-1);	/* remove trailing '\0' */
 }
}
コード例 #4
0
ファイル: lundump.c プロジェクト: rparet/darkpawns
static TString* LoadString (lua_State* L, ZIO* Z, int swap)
{
 size_t size=LoadSize(L,Z,swap);
 if (size==0)
  return NULL;
 else
 {
  char* s=luaO_openspace(L,size);
  LoadBlock(L,s,size,Z,0);
  return luaS_newlstr(L,s,size-1);  /* remove trailing '\0' */
 }
}
コード例 #5
0
ファイル: GSOsdManager.cpp プロジェクト: IlDucci/pcsx2
void GSOsdManager::LoadFont() {
	FT_Error error = FT_New_Face(m_library, theApp.GetConfigS("osd_fontname").c_str(), 0, &m_face);
	if (error) {
		m_face = NULL;
		fprintf(stderr, "Failed to init the freetype face\n");
		if(error == FT_Err_Unknown_File_Format)
			fprintf(stderr, "\tFreetype unknown file format\n");

		return;
	}

	LoadSize();
}
コード例 #6
0
bool CStdinMapReduceDocsReader::GetNextDocInfo(Stroka& /*strFilePath*/, SDocumentAttribtes& attrs)
{
    try {
        attrs.Reset();

        Stroka key;
        Stroka subKey;
        Stroka value;

        try { // let's catch exception at EOF

            if (Subkey == "") // no subkey used
                ReadLV(Cin, key);
            else {
                while (true) {
                    ReadLV(Cin, key);
                    ReadLV(Cin, subKey);
                    if (subKey == Subkey)
                        break; // right subkey found
                    else
                        ReadLV(Cin, value);
                }
            }
            DocLen = LoadSize(&Cin);

        } catch (yexception& ) {
            return false;
        }

        attrs.m_iDocID = ++CurrentDocNumber;
        attrs.m_strUrl = key;
        size_t pos = attrs.m_strUrl.find('/');
        attrs.m_strSource = (pos == Stroka::npos) ? attrs.m_strUrl : attrs.m_strUrl.substr(0, pos);

        ++CurrentDocNumber;
        if (CurrentDocNumber > LastDocNumber)
            return false;

        GetAgNameByDoc(attrs.m_iDocID, attrs.m_iSourceID, attrs.m_strSource);

        if (attrs.m_strSource.empty())
            attrs.m_strSource = attrs.m_strUrl;

    } catch (yexception& e) {
        Cerr << e.what() << Endl;
    } catch (...) {
        Cerr << "Error in \"CStdinMapReduceDocsReader::GetNextDocInfo\" proccessing DocN " << attrs.m_iDocID << Endl;
    }

    return true;
}