Пример #1
0
void OSMDIChildWnd::setWindowFlags() {
  #ifdef WIN32
  SetWindowLong(gethWnd(), GWL_STYLE, WS_CHILDWINDOW | WS_OVERLAPPED | WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | (isVisible(1) ? WS_VISIBLE : 0));
  SetWindowLong(gethWnd(), GWL_EXSTYLE, WS_EX_MDICHILD | WS_EX_WINDOWEDGE);
  SetWindowRgn(gethWnd(), NULL, TRUE);
  #endif
}
Пример #2
0
VOID MDIFrame::onOpen() {
  String tmpfile;
  OPENFILENAME l={sizeof(l),};
  l.lpstrFilter = "Image Files\0*.png;*.jpg\0";
  char *temp = (char *)GlobalAlloc(GMEM_FIXED,4096);
  temp[0] = 0;
  l.lpstrFile = temp;
  l.nMaxFile = 4095;
  l.lpstrTitle = "Load Image";
  l.lpstrDefExt = "";
  l.Flags = OFN_EXPLORER;
  if (GetOpenFileName(&l)) {
    tmpfile = temp;
  } else {
    GlobalFree(temp);
    return;
  }
  GlobalFree(temp);
  Bitmap *bmp = new Bitmap(tmpfile);
  if (bmp->isInvalid()) {
    MessageBox(gethWnd(), StringPrintf("Error loading %s", tmpfile.getValue()), "Error", 16);
    delete bmp;
  } else {
    MDIChild *child = new MDIChild(this, bmp);
    child->setName(tmpfile);
    child->setIcon(IDI_MDICHILD);
    addMDIChild(child); // self registers
  }
}
Пример #3
0
int OddcastWnd::onInit() {
	int retval = ODDCASTWND_PARENT::onInit();

	setPreferences( SUGGESTED_W, OC_WINDOW_WIDTH ); 
	setPreferences( SUGGESTED_H, OC_WINDOW_HEIGHT ); 
	setPreferences( MAXIMUM_W, OC_WINDOW_WIDTH ); 
	setPreferences( MAXIMUM_H, OC_WINDOW_HEIGHT ); 
	setPreferences( MINIMUM_W, OC_WINDOW_WIDTH ); 
	setPreferences( MINIMUM_H, OC_WINDOW_HEIGHT ); 

	api->core_addCallback(0, this);	// for on status change

	m_hInst = the->gethInstance(); //api->main_gethInstance();
	m_hWnd = gethWnd(); 


//	appcmds_addCmd("RLY", SRB_RELAY); 
	// Add your AppCmdI to the guiobjectwnd 
//	getGuiObject()->guiobject_addAppCmds(this); 

	m_vu_on_off = 0;
	transcode_init();
	setOggEncoderText("Winamp 3 DSP");
	setTimer(myTimer, myTimerDuration);
	return retval;
}
Пример #4
0
void OSDockWnd::setDockSnapable(int snapable) {
  if (snapable == m_snapable) return;
  m_snapable = snapable;
  if (isInited()) {
    invalidate();
    UpdateWindow(gethWnd());
  }
}
Пример #5
0
void OSMDIChildWnd::activate() {
#ifdef WIN32
  // slightly different for us
  RootWnd * parent = getParent();
  if ( parent )
    SendMessage(parent->gethWnd(), WM_MDIACTIVATE, (WPARAM)gethWnd(), 0);
#else
#warning port me
#endif
}
Пример #6
0
int OSDockWnd::onMouseMove(int x, int y) {
  OSDOCKWND_PARENT::onMouseMove(x, y);
  POINT pt={x,y};
  if (m_snap_bdown) {
    if (PtInRect(&m_snapbtn, pt)) {
      if (!m_snap_inarea) {
        m_snap_inarea = 1;
        invalidateRect(&m_snapbtn);
        UpdateWindow(gethWnd());
      }
    } else {
      if (m_snap_inarea) {
        m_snap_inarea = 0;
        invalidateRect(&m_snapbtn);
        UpdateWindow(gethWnd());
      }
    }
  }
  return 1;
}
Пример #7
0
void GLWnd::glShutdown() {
  glDeleteTextures();
  if (m_rendercontext) {
    wglDeleteContext(m_rendercontext);
    m_rendercontext = NULL;
  }
  if (m_dc) {
    StdWnd::releaseDC(gethWnd(), m_dc);
    m_dc = NULL;
  }
}
Пример #8
0
int OSDockWnd::onLeftButtonDown(int x, int y) {
  OSDOCKWND_PARENT::onLeftButtonDown(x, y);
  POINT pt={x,y};
  if (PtInRect(&m_snapbtn, pt)) {
    m_snap_bdown = 1;
    m_snap_inarea = 1;
    beginCapture();
    invalidateRect(&m_snapbtn);
    UpdateWindow(gethWnd());
  }
  return 1;
}
Пример #9
0
void OSMDIChildWnd::onSetName() {
  if (getMDIParent() != NULL) getMDIParent()->onMDIChildNameChange(this);
  if (!isMaximized()) SetWindowText(gethWnd(), getName());
}
Пример #10
0
void GLWnd::glInit() {
  if (m_rendercontext || m_dc) glShutdown();

  OSWINDOWHANDLE tmpwnd = NULL;
  HDC tmpdc = NULL;

  tmpwnd = StdWnd::createWnd(0, 0, 10, 10, TRUE, 0, NULL, WASABI_API_APP->main_gethInstance(), "WGLDUMMY", wglDummyWndProc, NULL);
  tmpdc = GetDC(tmpwnd);

  PIXELFORMATDESCRIPTOR pfd;
  MEMSET(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
  pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
  pfd.nVersion = 1;
  pfd.dwFlags = PFD_SUPPORT_OPENGL|(m_doublebuffered?PFD_DOUBLEBUFFER:0)|PFD_DRAW_TO_WINDOW|PFD_GENERIC_ACCELERATED;
  pfd.iPixelType = PFD_TYPE_RGBA;
  // todo: make this configurable
  pfd.cColorBits = 24;
  pfd.cDepthBits = 16;
  pfd.cAlphaBits = 8;
  pfd.cStencilBits = 16;
  pfd.iLayerType = PFD_MAIN_PLANE;

  HGLRC tmprc;
  int baseformat = ChoosePixelFormat(tmpdc, &pfd);
  if (baseformat == 0 || !SetPixelFormat(tmpdc, baseformat, &pfd) || ((tmprc = wglCreateContext(tmpdc)) == NULL)) {
	  ReleaseDC(tmpwnd, tmpdc);
	  StdWnd::destroyWnd(tmpwnd);
    // could not even create a simple opengl window
    return;
  }
  int reqformat = baseformat;
  if (m_wantmultisampling) {
    wglMakeCurrent(tmpdc, tmprc);
    m_multisampling = 0;
    if (GLeeInit()) {
      if (GLEE_ARB_multisample) {
        int pixelFormat;
        BOOL bStatus;
        UINT numFormats;
        float fAttributes[] = {0,0};
        int iAttributes[] = { WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
	                            WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
	                            WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
	                            WGL_COLOR_BITS_ARB,24,
	                            WGL_ALPHA_BITS_ARB,8,
	                            WGL_DEPTH_BITS_ARB,16,
	                            WGL_STENCIL_BITS_ARB,0,
	                            WGL_DOUBLE_BUFFER_ARB, m_doublebuffered?GL_TRUE:GL_FALSE,
	                            WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
	                            WGL_SAMPLES_ARB,4,
	                            0,0};
    
        bStatus = wglChoosePixelFormatARB(tmpdc,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
        if ((bStatus == GL_TRUE) && (numFormats >= 1)) {
          m_multisampling = 1;
	        reqformat = pixelFormat;
        } else {
          // ok that failed, try using 2 samples now instead of 4
          iAttributes[19] = 2;
          bStatus = wglChoosePixelFormatARB(tmpdc,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
          if ((bStatus == GL_TRUE) && (numFormats >= 1)) {
            m_multisampling = 1;
  	        reqformat = pixelFormat;	  
          }
        }
      }
    }
  }

  wglMakeCurrent(NULL, NULL);
  ReleaseDC(tmpwnd, tmpdc);
  wglDeleteContext(tmprc);
  StdWnd::destroyWnd(tmpwnd);

  m_dc = StdWnd::getDC(gethWnd());

  SetPixelFormat(m_dc, reqformat, &pfd);

  m_rendercontext = wglCreateContext(m_dc);
  wglMakeCurrent(m_dc, m_rendercontext);

  GLeeInit();
  resetWaitVertical();
}