freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master 3fa17ed 1/4: [graph] Icon support framework.


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master 3fa17ed 1/4: [graph] Icon support framework.
Date: Thu, 15 Oct 2020 23:36:33 -0400 (EDT)

branch: master
commit 3fa17ed6a07396790714a9e58d4ea3608dbf9f67
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [graph] Icon support framework.
    
    * graph/grdevice.c (grSetIcon): Define new function.
    * graph/graph.h (grSetIcon): Declare it.
    * graph/grobjs.c (grSetIconFunc): Declare the driver backend.
    (grSurface): Add it.
---
 ChangeLog        |  9 +++++++++
 graph/graph.h    | 27 ++++++++++++++++++++++++---
 graph/grdevice.c | 30 +++++++++++++++++++++++++++++-
 graph/grobjs.h   |  4 ++++
 4 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d5b0cf1..80fc146 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-10-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [graph] Icon support framework.
+
+       * graph/grdevice.c (grSetIcon): Define new function.
+       * graph/graph.h (grSetIcon): Declare it.
+       * graph/grobjs.c (grSetIconFunc): Declare the driver backend.
+       (grSurface): Add it.
+
 2020-10-11  Werner Lemberg  <wl@gnu.org>
 
        * src/ftmemchk.c: Include `compiler-macros.h'.
diff --git a/graph/graph.h b/graph/graph.h
index ce681a3..4086e77 100644
--- a/graph/graph.h
+++ b/graph/graph.h
@@ -115,7 +115,6 @@
   } grColor;
 
 
-
  /**********************************************************************
   *
   * <Function>
@@ -259,6 +258,7 @@
                            const char* string,
                            grColor     color );
 
+
  /**********************************************************************
   *
   * <Function>
@@ -456,7 +456,6 @@
                                  grPixelMode*  *pixel_modes );
 
 
-
  /**********************************************************************
   *
   * <Function>
@@ -504,6 +503,7 @@
 
   extern void  grDoneSurface( grSurface*  surface );
 
+
  /**********************************************************************
   *
   * <Function>
@@ -547,7 +547,6 @@
   extern void  grRefreshSurface( grSurface*  surface );
 
 
-
  /**********************************************************************
   *
   * <Function>
@@ -630,6 +629,28 @@
                            const char* title_string );
 
 
+ /**********************************************************************
+  *
+  * <Function>
+  *    grSetIcon
+  *
+  * <Description>
+  *    set the icon of a given windowed surface.
+  *
+  * <Input>
+  *    surface :: handle to target surface
+  *    icon    :: handle to icon bitmap
+  *
+  * <Return>
+  *    the next appropriate icon size in pixels.
+  *
+  * <Note>
+  *    Returns the largest appropriate icon size if icon is NULL.
+  *
+  **********************************************************************/
+
+  extern int  grSetIcon( grSurface*  surface,
+                         grBitmap*   icon );
 
 
  /**********************************************************************
diff --git a/graph/grdevice.c b/graph/grdevice.c
index a0dc840..1bcf688 100644
--- a/graph/grdevice.c
+++ b/graph/grdevice.c
@@ -309,7 +309,6 @@
   }
 
 
-
  /**********************************************************************
   *
   * <Function>
@@ -332,6 +331,35 @@
   }
 
 
+ /**********************************************************************
+ *
+ * <Function>
+ *    grSetIcon
+ *
+ * <Description>
+ *    set the icon of a given windowed surface.
+ *
+ * <Input>
+ *    surface :: handle to target surface
+ *    icon    :: handle to icon bitmap
+ *
+ * <Return>
+ *    the next appropriate icon size in pixels.
+ *
+ * <Note>
+ *    Returns the largest appropriate icon size if icon is NULL.
+ *
+ *
+ **********************************************************************/
+
+  extern int  grSetIcon( grSurface*  surface,
+                         grBitmap*   icon )
+  {
+    if (surface->set_icon)
+      return surface->set_icon( surface, icon );
+
+    return 0;
+  }
 
 
  /**********************************************************************
diff --git a/graph/grobjs.h b/graph/grobjs.h
index 4b72287..8c2a50c 100644
--- a/graph/grobjs.h
+++ b/graph/grobjs.h
@@ -96,6 +96,9 @@
   typedef void (*grSetTitleFunc)( grSurface*   surface,
                                   const char*  title_string );
 
+  typedef int  (*grSetIconFunc)( grSurface*  surface,
+                                 grBitmap*   icon );
+
   typedef void (*grRefreshRectFunc)( grSurface*  surface,
                                      int         x,
                                      int         y,
@@ -144,6 +147,7 @@
 
     grRefreshRectFunc  refresh_rect;
     grSetTitleFunc     set_title;
+    grSetIconFunc      set_icon;
     grListenEventFunc  listen_event;
     grDoneSurfaceFunc  done;
   };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]