<commit_before>// Filename: graphicsWindow.h
// Created by:  mike (09Jan97)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license.  You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// <EMAIL> .
//
////////////////////////////////////////////////////////////////////
#ifndef GRAPHICSWINDOW_H
#define GRAPHICSWINDOW_H
//
////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////
#include <pandabase.h>

#include "graphicsWindowInputDevice.h"
#include "graphicsChannel.h"
#include "displayRegion.h"
#include "graphicsStateGuardian.h"

#include <typedef.h>
#include <configurable.h>
#include <referenceCount.h>
#include <mouseData.h>
#include <modifierButtons.h>
#include <buttonEvent.h>
#include <iterator_types.h>
#include <factory.h>
#include <pStatCollector.h>

#include <string>
#include "pvector.h"
#include "pdeque.h"

////////////////////////////////////////////////////////////////////
// Defines
////////////////////////////////////////////////////////////////////
enum WindowModeType
{
    W_RGBA =                            0,
    W_RGB =                             0,
    W_INDEX =                           1,
    W_SINGLE =                          0,
    W_DOUBLE =                          2,
    W_ACCUM =                           4,
    W_ALPHA =                           8,
    W_DEPTH =                           16,
    W_STENCIL =                         32,
    W_MULTISAMPLE =                     128,
    W_STEREO =                          256,
    W_LUMINANCE =                       512
};

class GraphicsPipe;
class GraphicsWindow;

////////////////////////////////////////////////////////////////////
//       Class : GraphicsWindow
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA GraphicsWindow : public Configurable, public ReferenceCount {
public:
  class EXPCL_PANDA Properties {
  public:
    Properties();
  public:
    int _xorg;
    int _yorg;
    int _xsize;
    int _ysize;
    string _title;
    bool _border;
    bool _fullscreen;
    uint _mask;
    int _want_depth_bits;
    int _want_color_bits;
  };

  class EXPCL_PANDA Callback {
  public:
    virtual void draw(bool);
    virtual void idle();
  };
  typedef void (*vfn)();
  typedef void (*vfnii)(int, int);

public:

  GraphicsWindow(GraphicsPipe*);
#ifdef WIN32_VC
  GraphicsWindow(GraphicsPipe*, const Properties&);
#else
  GraphicsWindow(GraphicsPipe*, const GraphicsWindow::Properties&);
#endif
  virtual ~GraphicsWindow();

  INLINE const GraphicsWindow::Properties& get_properties() const;

PUBLISHED:
  INLINE int get_width() const;
  INLINE int get_height() const;
  INLINE int get_xorg() const;
  INLINE int get_yorg() const;

  virtual int get_depth_bitwidth(void);  // # of z bits/pixel

  INLINE GraphicsStateGuardian *get_gsg() const;
  INLINE GraphicsPipe *get_pipe() const;

  INLINE void close_window();
  INLINE bool is_closed() const;

  INLINE void set_frame_number(const int);
  INLINE int get_frame_number() const;

  INLINE void set_sync(const bool);
  INLINE bool get_sync() const;

  // resize the window to the given size
  virtual void resize(unsigned int xsize,unsigned int ysize);  

  // see if window sizes are supported (i.e. in fullscrn mode)
  // 
  // note: it might be better to implement some sort of query
  //       interface that returns an array of supported sizes,
  //       but this way is somewhat simpler and will do the job 
  //       on most cards, assuming they handle the std sizes the app
  //       knows about.
  virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);

  virtual void swap();

public:
  virtual void resized(const unsigned int, const unsigned int);

  INLINE virtual void set_draw_callback(Callback *c);
  INLINE virtual void set_idle_callback(Callback *c);

  INLINE void call_draw_callback(bool force_redraw);
  INLINE void call_idle_callback();

  PT(DisplayRegion) make_scratch_display_region(int xsize,
                                                int ysize) const;

  virtual TypeHandle get_gsg_type() const=0;

public:
  // context setting
  virtual void make_current();
  virtual void unmake_current();

PUBLISHED:
  // Mouse and keyboard routines
  INLINE int get_num_input_devices() const;
  INLINE string get_input_device_name(int device) const;
  INLINE bool has_pointer(int device) const;
  INLINE bool has_keyboard(int device) const;

  virtual void process_events(void) { return; };   // process window events

public:
  INLINE const MouseData &get_mouse_data(int device) const;<commit_msg>unpublish verify_window-size since interrogate cant handle it<commit_after>// Filename: graphicsWindow.h
// Created by:  mike (09Jan97)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license.  You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// <EMAIL> .
//
////////////////////////////////////////////////////////////////////
#ifndef GRAPHICSWINDOW_H
#define GRAPHICSWINDOW_H
//
////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////
#include <pandabase.h>

#include "graphicsWindowInputDevice.h"
#include "graphicsChannel.h"
#include "displayRegion.h"
#include "graphicsStateGuardian.h"

#include <typedef.h>
#include <configurable.h>
#include <referenceCount.h>
#include <mouseData.h>
#include <modifierButtons.h>
#include <buttonEvent.h>
#include <iterator_types.h>
#include <factory.h>
#include <pStatCollector.h>

#include <string>
#include "pvector.h"
#include "pdeque.h"

////////////////////////////////////////////////////////////////////
// Defines
////////////////////////////////////////////////////////////////////
enum WindowModeType
{
    W_RGBA =                            0,
    W_RGB =                             0,
    W_INDEX =                           1,
    W_SINGLE =                          0,
    W_DOUBLE =                          2,
    W_ACCUM =                           4,
    W_ALPHA =                           8,
    W_DEPTH =                           16,
    W_STENCIL =                         32,
    W_MULTISAMPLE =                     128,
    W_STEREO =                          256,
    W_LUMINANCE =                       512
};

class GraphicsPipe;
class GraphicsWindow;

////////////////////////////////////////////////////////////////////
//       Class : GraphicsWindow
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA GraphicsWindow : public Configurable, public ReferenceCount {
public:
  class EXPCL_PANDA Properties {
  public:
    Properties();
  public:
    int _xorg;
    int _yorg;
    int _xsize;
    int _ysize;
    string _title;
    bool _border;
    bool _fullscreen;
    uint _mask;
    int _want_depth_bits;
    int _want_color_bits;
  };

  class EXPCL_PANDA Callback {
  public:
    virtual void draw(bool);
    virtual void idle();
  };
  typedef void (*vfn)();
  typedef void (*vfnii)(int, int);

public:

  GraphicsWindow(GraphicsPipe*);
#ifdef WIN32_VC
  GraphicsWindow(GraphicsPipe*, const Properties&);
#else
  GraphicsWindow(GraphicsPipe*, const GraphicsWindow::Properties&);
#endif
  virtual ~GraphicsWindow();

  INLINE const GraphicsWindow::Properties& get_properties() const;

PUBLISHED:
  INLINE int get_width() const;
  INLINE int get_height() const;
  INLINE int get_xorg() const;
  INLINE int get_yorg() const;

  virtual int get_depth_bitwidth(void);  // # of z bits/pixel

  INLINE GraphicsStateGuardian *get_gsg() const;
  INLINE GraphicsPipe *get_pipe() const;

  INLINE void close_window();
  INLINE bool is_closed() const;

  INLINE void set_frame_number(const int);
  INLINE int get_frame_number() const;

  INLINE void set_sync(const bool);
  INLINE bool get_sync() const;

  // resize the window to the given size
  virtual void resize(unsigned int xsize,unsigned int ysize);  

  virtual void swap();

public:
  virtual void resized(const unsigned int, const unsigned int);

  // see if window sizes are supported (i.e. in fullscrn mode)
  // 
  // note: it might be better to implement some sort of query
  //       interface that returns an array of supported sizes,
  //       but this way is somewhat simpler and will do the job 
  //       on most cards, assuming they handle the std sizes the app
  //       knows about.
  virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);

  INLINE virtual void set_draw_callback(Callback *c);
  INLINE virtual void set_idle_callback(Callback *c);

  INLINE void call_draw_callback(bool force_redraw);
  INLINE void call_idle_callback();

  PT(DisplayRegion) make_scratch_display_region(int xsize,
                                                int ysize) const;

  virtual TypeHandle get_gsg_type() const=0;

public:
  // context setting
  virtual void make_current();
  virtual void unmake_current();

PUBLISHED:
  // Mouse and keyboard routines
  INLINE int get_num_input_devices() const;
  INLINE string get_input_device_name(int device) const;
  INLINE bool has_pointer(int device) const;
  INLINE bool has_keyboard(int device) const;

  virtual void process_events(void) { return; };   // process window events

public:
  INLINE const MouseData &get_mouse_data(int device) const;
{'fraction_non_alphanumeric': 0.184574363025874, 'fraction_numerical': 0.006715386134702746, 'mean_word_length': 1.872093023255814, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4209183', 'n_tokens_mistral': 2878, 'n_tokens_neox': 2703, 'n_words': 863}