[Bf-blender-cvs] [d95ccc21758] master: Cleanup: remove unused GHOST quit dialog code

Brecht Van Lommel noreply at git.blender.org
Sat May 18 10:45:48 CEST 2019


Commit: d95ccc21758983e3ec2800285fb7fd2aed807189
Author: Brecht Van Lommel
Date:   Sat May 18 10:35:06 2019 +0200
Branches: master
https://developer.blender.org/rBd95ccc21758983e3ec2800285fb7fd2aed807189

Cleanup: remove unused GHOST quit dialog code

===================================================================

M	intern/ghost/GHOST_C-api.h
M	intern/ghost/GHOST_ISystem.h
M	intern/ghost/intern/GHOST_C-api.cpp
M	intern/ghost/intern/GHOST_System.cpp
M	intern/ghost/intern/GHOST_System.h
M	intern/ghost/intern/GHOST_SystemCocoa.h
M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	intern/ghost/intern/GHOST_SystemNULL.h
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_SystemSDL.h
M	intern/ghost/intern/GHOST_SystemWin32.cpp
M	intern/ghost/intern/GHOST_SystemWin32.h
M	intern/ghost/intern/GHOST_SystemX11.cpp
M	intern/ghost/intern/GHOST_SystemX11.h

===================================================================

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 6c490e51b0d..6f92adde0b2 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -905,17 +905,6 @@ extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
  */
 extern int GHOST_toggleConsole(int action);
 
-/**
- * Confirms quitting he program when there is just one window left open
- * in the application
- */
-extern int GHOST_confirmQuit(GHOST_WindowHandle windowhandle);
-
-/**
- * Informs if the system provides native dialogs (eg. confirm quit)
- */
-extern int GHOST_SupportsNativeDialogs(void);
-
 /**
  * Use native pixel size (MacBook pro 'retina'), if supported.
  */
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 3c93d21f30f..51fa2194f2c 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -435,17 +435,6 @@ class GHOST_ISystem {
    */
   virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
 
-  /**
-   * Confirms quitting he program when there is just one window left open
-   * in the application
-   */
-  virtual int confirmQuit(GHOST_IWindow *window) const = 0;
-
-  /**
-   * Informs if the system provides native dialogs (eg. confirm quit)
-   */
-  virtual bool supportsNativeDialogs(void) = 0;
-
  protected:
   /**
    * Initialize the system.
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 3848c723e5b..c8ee2e44efe 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -788,18 +788,6 @@ int GHOST_toggleConsole(int action)
   return system->toggleConsole(action);
 }
 
-int GHOST_SupportsNativeDialogs(void)
-{
-  GHOST_ISystem *system = GHOST_ISystem::getSystem();
-  return system->supportsNativeDialogs();
-}
-
-int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
-{
-  GHOST_ISystem *system = GHOST_ISystem::getSystem();
-  return system->confirmQuit((GHOST_IWindow *)windowhandle);
-}
-
 int GHOST_UseNativePixels(void)
 {
   GHOST_ISystem *system = GHOST_ISystem::getSystem();
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index a696afeae02..21935abed9c 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -378,16 +378,6 @@ GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window,
   return (*window == NULL) ? GHOST_kFailure : GHOST_kSuccess;
 }
 
-int GHOST_System::confirmQuit(GHOST_IWindow * /*window*/) const
-{
-  return 1;
-}
-
-bool GHOST_System::supportsNativeDialogs(void)
-{
-  return 1;
-}
-
 bool GHOST_System::useNativePixel(void)
 {
   m_nativePixel = true;
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index a62641c5cf5..fbf8af01e59 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -317,17 +317,6 @@ class GHOST_System : public GHOST_ISystem {
    */
   virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
 
-  /**
-   * Confirms quitting he program when there is just one window left open
-   * in the application
-   */
-  virtual int confirmQuit(GHOST_IWindow *window) const;
-
-  /**
-   * Informs if the system provides native dialogs (eg. confirm quit)
-   */
-  virtual bool supportsNativeDialogs(void);
-
  protected:
   /**
    * Initialize the system.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index 1201b5c4a14..109dd6c180d 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -269,11 +269,6 @@ class GHOST_SystemCocoa : public GHOST_System {
    */
   GHOST_TSuccess handleKeyEvent(void *eventPtr);
 
-  /**
-   * Informs if the system provides native dialogs (eg. confirm quit)
-   */
-  virtual bool supportsNativeDialogs(void);
-
  protected:
   /**
    * Initializes the system.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 9afc882955c..0424b96523b 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1958,8 +1958,3 @@ void GHOST_SystemCocoa::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 
   [pool drain];
 }
-
-bool GHOST_SystemCocoa::supportsNativeDialogs(void)
-{
-  return false;
-}
diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h
index 2a07633dc51..93aea87e9a6 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -82,10 +82,6 @@ class GHOST_SystemNULL : public GHOST_System {
   void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
   { /* nop */
   }
-  bool supportsNativeDialogs(void)
-  {
-    return false;
-  }
   GHOST_IContext *createOffscreenContext()
   {
     return NULL;
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index 18163882cec..8fc7046565d 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -721,11 +721,6 @@ void GHOST_SystemSDL::addDirtyWindow(GHOST_WindowSDL *bad_wind)
   m_dirty_windows.push_back(bad_wind);
 }
 
-bool GHOST_SystemSDL::supportsNativeDialogs(void)
-{
-  return false;
-}
-
 GHOST_TSuccess GHOST_SystemSDL::getButtons(GHOST_Buttons &buttons) const
 {
   Uint8 state = SDL_GetMouseState(NULL, NULL);
diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h
index e51cc3d5b5d..7dbdc3ccec8 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.h
+++ b/intern/ghost/intern/GHOST_SystemSDL.h
@@ -77,11 +77,6 @@ class GHOST_SystemSDL : public GHOST_System {
 
   GHOST_TSuccess disposeContext(GHOST_IContext *context);
 
-  /**
-   * Informs if the system provides native dialogs (eg. confirm quit)
-   */
-  virtual bool supportsNativeDialogs(void);
-
  private:
   GHOST_TSuccess init();
 
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 5d882fd6dcb..deb10377b7d 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1872,11 +1872,3 @@ int GHOST_SystemWin32::toggleConsole(int action)
 
   return m_consoleStatus;
 }
-
-int GHOST_SystemWin32::confirmQuit(GHOST_IWindow *window) const
-{
-  return (MessageBox(window ? ((GHOST_WindowWin32 *)window)->getHWND() : 0,
-                     "Some changes have not been saved.\nDo you really want to quit?",
-                     "Exit Blender",
-                     MB_OKCANCEL | MB_ICONWARNING | MB_TOPMOST) == IDOK);
-}
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index 98b18d2c00b..7ac6a3e3e20 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -221,12 +221,6 @@ class GHOST_SystemWin32 : public GHOST_System {
                                           int mouseY,
                                           void *data);
 
-  /**
-   * Confirms quitting he program when there is just one window left open
-   * in the application
-   */
-  int confirmQuit(GHOST_IWindow *window) const;
-
  protected:
   /**
    * Initializes the system.
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index c688d7713b2..b95e5fe3846 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -376,11 +376,6 @@ GHOST_IWindow *GHOST_SystemX11::createWindow(const STR_String &title,
   return window;
 }
 
-bool GHOST_SystemX11::supportsNativeDialogs(void)
-{
-  return false;
-}
-
 /**
  * Create a new offscreen context.
  * Never explicitly delete the context, use disposeContext() instead.
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index f7f33185f9b..5c474142534 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -90,11 +90,6 @@ class GHOST_SystemX11 : public GHOST_System {
 
   GHOST_TSuccess init();
 
-  /**
-   * Informs if the system provides native dialogs (eg. confirm quit)
-   */
-  virtual bool supportsNativeDialogs(void);
-
   /**
    * \section Interface Inherited from GHOST_ISystem
    */



More information about the Bf-blender-cvs mailing list