]> Pileus Git - ~andy/gtk/commitdiff
Make more GdkAtom variables visible in all gdk/win32 files
authorTor Lillqvist <tml@iki.fi>
Sun, 15 Nov 2009 01:49:22 +0000 (03:49 +0200)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 4 Apr 2010 00:51:51 +0000 (20:51 -0400)
Make the GdkAtoms for the image formats extern and usable from all
gdk/win32 files.

gdk/win32/gdkglobals-win32.c
gdk/win32/gdkmain-win32.c
gdk/win32/gdkprivate-win32.h
gdk/win32/gdkselection-win32.c

index d30ad32e5bffb90572f8bf75ba4d1c0b9393affa..ef1dbecf420bebc4ef37b947ed8f23b8bef82f19 100644 (file)
@@ -54,6 +54,10 @@ GdkAtom           _utf8_string;
 GdkAtom                  _text;
 GdkAtom                  _compound_text;
 GdkAtom                  _text_uri_list;
+GdkAtom                  _image_png;
+GdkAtom                  _image_jpeg;
+GdkAtom                  _image_bmp;
+GdkAtom                  _image_gif;
 
 GdkAtom                  _local_dnd;
 GdkAtom                  _gdk_win32_dropfiles;
index 49bd59e61754d2b36ed415c418454713562f0ce7..f1afdf2eee7aed08298b1aac2276dd63335f4fcf 100644 (file)
@@ -108,6 +108,10 @@ _gdk_windowing_init (void)
   _text = gdk_atom_intern ("TEXT", FALSE);
   _compound_text = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
   _text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
+  _image_png = gdk_atom_intern ("image/png", FALSE);
+  _image_jpeg = gdk_atom_intern ("image/jpeg", FALSE);
+  _image_bmp = gdk_atom_intern ("image/bmp", FALSE);
+  _image_gif = gdk_atom_intern ("image/gif", FALSE);
 
   _local_dnd = gdk_atom_intern ("LocalDndSelection", FALSE);
   _gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
index be741cf538a933e001e0e50f341795637ac00949..3eda1a98349cc11eee8eef4ba037d635d996f667 100644 (file)
@@ -416,6 +416,10 @@ extern GdkAtom           _utf8_string;
 extern GdkAtom          _text;
 extern GdkAtom          _compound_text;
 extern GdkAtom          _text_uri_list;
+extern GdkAtom          _image_png;
+extern GdkAtom          _image_jpeg;
+extern GdkAtom          _image_bmp;
+extern GdkAtom          _image_gif;
 
 /* DND selections */
 extern GdkAtom           _local_dnd;
index dea0aa11f4e3e061db63069cf8c825292671b0d6..0f6b165165d5304852957dca550dda88f9688697 100644 (file)
@@ -63,10 +63,6 @@ static UINT cf_gif;
 /* GdkAtoms for well-known image formats */
 static GdkAtom *known_pixbuf_formats;
 static int n_known_pixbuf_formats;
-static GdkAtom image_png;
-static GdkAtom image_jpeg;
-static GdkAtom image_bmp;
-static GdkAtom image_gif;
 
 /* GdkAtoms for well-known text formats */
 static GdkAtom text_plain;
@@ -122,22 +118,17 @@ _gdk_win32_selection_init (void)
 
   g_slist_free (pixbuf_formats);
   
-  image_png = gdk_atom_intern ("image/png", FALSE);
-  image_jpeg = gdk_atom_intern ("image/jpeg", FALSE);
-  image_bmp = gdk_atom_intern ("image/bmp", FALSE);
-  image_gif = gdk_atom_intern ("image/gif", FALSE);
-
   text_plain = gdk_atom_intern ("text/plain", FALSE);
   text_plain_charset_utf_8= gdk_atom_intern ("text/plain;charset=utf-8", FALSE);
   text_plain_charset_CP1252 = gdk_atom_intern ("text/plain;charset=CP1252", FALSE);
 
   g_hash_table_replace (_format_atom_table,
                        GINT_TO_POINTER (cf_png),
-                       image_png);
+                       _image_png);
 
   g_hash_table_replace (_format_atom_table,
                        GINT_TO_POINTER (CF_DIB),
-                       image_bmp);
+                       _image_bmp);
 }
 
 /* The specifications for COMPOUND_TEXT and STRING specify that C0 and
@@ -263,13 +254,13 @@ _gdk_dropfiles_store (gchar *data)
 static gchar *
 get_mapped_gdk_atom_name (GdkAtom gdk_target)
 {
-  if (gdk_target == image_png)
+  if (gdk_target == _image_png)
     return g_strdup ("PNG");
 
-  if (gdk_target == image_jpeg)
+  if (gdk_target == _image_jpeg)
     return g_strdup ("JFIF");
   
-  if (gdk_target == image_gif)
+  if (gdk_target == _image_gif)
     return g_strdup ("GIF");
   
   return gdk_atom_name (gdk_target);
@@ -453,7 +444,7 @@ gdk_selection_convert (GdkWindow *requestor,
        {
          if (fmt == cf_png)
            {
-             targets[ntargets++] = image_png;
+             targets[ntargets++] = _image_png;
              has_png = TRUE;
            }
        }
@@ -481,21 +472,21 @@ gdk_selection_convert (GdkWindow *requestor,
               * transparency.
               */
              if (!has_bmp && !has_png)
-               targets[ntargets++] = image_bmp;
+               targets[ntargets++] = _image_bmp;
              has_bmp = TRUE;
            }
          else if (fmt == cf_jfif)
            {
              /* Ditto for JPEG */
              if (!has_png)
-               targets[ntargets++] = image_jpeg;
+               targets[ntargets++] = _image_jpeg;
            }
          else if (fmt == cf_gif)
            {
              /* Ditto for GIF.
               */
              if (!has_png)
-               targets[ntargets++] = image_gif;
+               targets[ntargets++] = _image_gif;
            }
          else if (GetClipboardFormatName (fmt, sFormat, 80) > 0)
            {
@@ -592,7 +583,7 @@ gdk_selection_convert (GdkWindow *requestor,
 
       API_CALL (CloseClipboard, ());
     }
-  else if (selection == GDK_SELECTION_CLIPBOARD && target == image_bmp)
+  else if (selection == GDK_SELECTION_CLIPBOARD && target == _image_bmp)
     {
       if (!API_CALL (OpenClipboard, (GDK_WINDOW_HWND (requestor))))
        return;
@@ -746,7 +737,7 @@ gdk_selection_convert (GdkWindow *requestor,
                              data_length);
                    }
 
-                 selection_property_store (requestor, image_bmp, 8,
+                 selection_property_store (requestor, _image_bmp, 8,
                                            data, new_length);
                 }
              GlobalUnlock (hdata);
@@ -1294,7 +1285,7 @@ _gdk_win32_selection_convert_to_dib (HGLOBAL  hdata,
       g_free (target_name);
     });
 
-  if (target == image_bmp)
+  if (target == _image_bmp)
     {
       /* No conversion is needed, just strip the BITMAPFILEHEADER */
       HGLOBAL hdatanew;