亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gdkcolor-win32.c

?? linux下電話本所依賴的一些圖形庫
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* GDK - The GIMP Drawing Kit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright (C) 1998-2002 Tor Lillqvist * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. *//* * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS * file for a list of people on the GTK+ Team.  See the ChangeLog * files for a list of changes.  These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/.  */#include <config.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "gdkcolor.h"#include "gdkscreen.h"#include "gdkinternals.h"#include "gdkprivate-win32.h"static gint     gdk_colormap_match_color (GdkColormap      *cmap,					  GdkColor         *color,					  const gchar      *available);static void     gdk_colormap_init        (GdkColormap      *colormap);static void     gdk_colormap_class_init  (GdkColormapClass *klass);static void     gdk_colormap_finalize    (GObject          *object);static gpointer parent_class = NULL;GTypegdk_colormap_get_type (void){  static GType object_type = 0;  if (!object_type)    {      static const GTypeInfo object_info =      {        sizeof (GdkColormapClass),        (GBaseInitFunc) NULL,        (GBaseFinalizeFunc) NULL,        (GClassInitFunc) gdk_colormap_class_init,        NULL,           /* class_finalize */        NULL,           /* class_data */        sizeof (GdkColormap),        0,              /* n_preallocs */        (GInstanceInitFunc) gdk_colormap_init,      };            object_type = g_type_register_static (G_TYPE_OBJECT,                                            "GdkColormap",                                            &object_info, 0);    }    return object_type;}static voidgdk_colormap_init (GdkColormap *colormap){  GdkColormapPrivateWin32 *private;  private = g_new (GdkColormapPrivateWin32, 1);  colormap->windowing_data = private;    private->hpal = NULL;  private->current_size = 0;  private->use = NULL;  private->hash = NULL;  private->info = NULL;  colormap->size = 0;  colormap->colors = NULL;}static voidgdk_colormap_class_init (GdkColormapClass *klass){  GObjectClass *object_class = G_OBJECT_CLASS (klass);  parent_class = g_type_class_peek_parent (klass);  object_class->finalize = gdk_colormap_finalize;}static voidgdk_colormap_finalize (GObject *object){  GdkColormap *colormap = GDK_COLORMAP (object);  GdkColormapPrivateWin32 *private = GDK_WIN32_COLORMAP_DATA (colormap);  if (!DeleteObject (private->hpal))    WIN32_GDI_FAILED ("DeleteObject");  if (private->hash)    g_hash_table_destroy (private->hash);    g_free (private->info);  g_free (colormap->colors);  g_free (private);    G_OBJECT_CLASS (parent_class)->finalize (object);}/* Mimics XAllocColorCells. Allocate read/write color cells. */static gbooleanalloc_color_cells (GdkColormap    *cmap,		   gboolean        contig,		   unsigned long   plane_masks_return[],		   unsigned int    nplanes,		   unsigned long   pixels_return[],		   unsigned int	   npixels){  GdkColormapPrivateWin32 *cmapp = GDK_WIN32_COLORMAP_DATA (cmap);  gint i, nfree, iret, start = 0;  GDK_NOTE (COLORMAP, g_print ("alloc_color_cells: cmap=%p contig=%s npl=%d npix=%d",			       cmapp, contig ? "TRUE" : "FALSE",			       nplanes, npixels));  switch (cmap->visual->type)    {    case GDK_VISUAL_GRAYSCALE:    case GDK_VISUAL_PSEUDO_COLOR:      nfree = 0;      for (i = 0; i < cmap->size && nfree < npixels; i++)	if (cmapp->use[i] == GDK_WIN32_PE_AVAILABLE &&	    (!contig ||	     (nfree == 0 || cmapp->use[i-1] == GDK_WIN32_PE_AVAILABLE)))	  {	    if (nfree == 0)	      start = i;	    nfree++;	  }	else if (contig)	  nfree = 0;      if (npixels > nfree)	{	  GDK_NOTE (COLORMAP, g_print ("...nope (%d > %d)\n", npixels, nfree));	  return FALSE;	}      else	GDK_NOTE (COLORMAP, g_print ("...ok\n"));      iret = 0;      for (i = start; i < cmap->size && iret < npixels; i++)	if (cmapp->use[i] == GDK_WIN32_PE_AVAILABLE)	  {	    cmapp->use[i] = GDK_WIN32_PE_INUSE;	    pixels_return[iret] = i;	    iret++;	  }      g_assert (iret == npixels);      break;    default:      g_assert_not_reached ();    }  return TRUE;}/* The following functions are originally from Tk8.0, but heavily   modified.  Here are tk's licensing terms. I hope these terms don't   conflict with the GNU Lesser General Public License? They   shouldn't, as they are looser that the GLPL, yes? *//*This software is copyrighted by the Regents of the University ofCalifornia, Sun Microsystems, Inc., and other parties.  The followingterms apply to all files associated with the software unless explicitlydisclaimed in individual files.The authors hereby grant permission to use, copy, modify, distribute,and license this software and its documentation for any purpose, providedthat existing copyright notices are retained in all copies and that thisnotice is included verbatim in any distributions. No written agreement,license, or royalty fee is required for any of the authorized uses.Modifications to this software may be copyrighted by their authorsand need not follow the licensing terms described here, provided thatthe new terms are clearly indicated on the first page of each file wherethey apply.IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTYFOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGESARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANYDERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWAREIS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVENO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, ORMODIFICATIONS.GOVERNMENT USE: If you are acquiring this software on behalf of theU.S. government, the Government shall have only "Restricted Rights"in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If youare acquiring the software on behalf of the Department of Defense, thesoftware shall be classified as "Commercial Computer Software" and theGovernment shall have only "Restricted Rights" as defined in Clause252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, theauthors grant the U.S. Government and others acting in its behalfpermission to use and distribute the software in accordance with theterms specified in this license.*//* Mimics XAllocColor. Allocate a read-only colormap entry. */static intalloc_color (GdkColormap  *cmap,	     PALETTEENTRY *color,	     guint        *pixelp){  PALETTEENTRY entry, close_entry;  COLORREF new_pixel;  UINT index;  GdkColormapPrivateWin32 *cmapp = GDK_WIN32_COLORMAP_DATA (cmap);  gint i;      entry = *color;  entry.peFlags = 0;  new_pixel = RGB (entry.peRed, entry.peGreen, entry.peBlue);  switch (cmap->visual->type)    {    case GDK_VISUAL_PSEUDO_COLOR:      /* Find the nearest existing palette entry. */      index = GetNearestPaletteIndex (cmapp->hpal, new_pixel);      GetPaletteEntries (cmapp->hpal, index, 1, &close_entry);      GDK_NOTE (COLORMAP,		g_print ("alloc_color: new_pixel=%06lx index=%d=%02x close=%06lx\n",			 new_pixel, index, index,			 RGB (close_entry.peRed, close_entry.peGreen, close_entry.peBlue)));      if (new_pixel != RGB (close_entry.peRed, close_entry.peGreen,			    close_entry.peBlue))	{	  /* Not a perfect match. */	  if (cmapp->use[index] == GDK_WIN32_PE_AVAILABLE)	    {	      /* It was a nonused entry anyway, so we can use it, and	       * set it to the correct color.	       */	      GDK_NOTE (COLORMAP, g_print ("...was free\n"));	      if (!SetPaletteEntries (cmapp->hpal, index, 1, &entry))		WIN32_GDI_FAILED ("SetPaletteEntries");	    }	  else	    {	      /* The close entry found is in use, so search for a	       * available slot.	       */	      gboolean done = FALSE;	      for (i = 0; i < cmap->size; i++)		if (cmapp->use[i] == GDK_WIN32_PE_AVAILABLE)		  {		    /* An available slot, use it. */		    GDK_NOTE (COLORMAP,			      g_print ("...use free slot %d%s\n",				       i, (i >= cmapp->current_size) ?				       ", will resize palette" : ""));		    if (i >= cmapp->current_size)		      {			if (!ResizePalette (cmapp->hpal, i + 1))			  {			    WIN32_GDI_FAILED ("ResizePalette");			    break;			  }			cmapp->current_size = i + 1;		      }		    if (!SetPaletteEntries (cmapp->hpal, i, 1, &entry))		      {			WIN32_GDI_FAILED ("SetPaletteEntries");			i = cmap->size;		      }		    else		      {			done = TRUE;			index = i;		      }		    break;		  }	      if (!done)		{		  /* No free slots available, or failed to resize		   * palette or set palette entry.		   */		  GDK_NOTE (COLORMAP, g_print ("... failure\n"));		  return FALSE;		}	    }	}      else	{	  /* We got a match, so use it. */	}      *pixelp = index;      cmapp->use[index] = GDK_WIN32_PE_INUSE;      GDK_NOTE (COLORMAP, g_print ("alloc_color: %p: "				   "index=%3d=%02x for %02x %02x %02x: "				   "%02x %02x %02x\n",				   cmapp->hpal, index, index,				   entry.peRed, entry.peGreen, entry.peBlue,				   color->peRed, color->peGreen, color->peBlue));      return TRUE;    case GDK_VISUAL_STATIC_COLOR:      /* Find the nearest existing palette entry. */      index = GetNearestPaletteIndex (cmapp->hpal, new_pixel);      GetPaletteEntries (cmapp->hpal, index, 1, &close_entry);      *color = close_entry;      *pixelp = index;      GDK_NOTE (COLORMAP, g_print ("alloc_color %p: "				   "index=%3d=%02x for %02x %02x %02x: "				   "%02x %02x %02x\n",				   cmapp->hpal, index, index,				   entry.peRed, entry.peGreen, entry.peBlue,				   color->peRed, color->peGreen, color->peBlue));      return TRUE;    case GDK_VISUAL_TRUE_COLOR:      /* Determine what color will actually be used on non-colormap systems. */      *pixelp = GetNearestColor (_gdk_display_hdc, new_pixel);      color->peRed = GetRValue (*pixelp);      color->peGreen = GetGValue (*pixelp);      color->peBlue = GetBValue (*pixelp);      return TRUE;    default:      g_error ("cmap->visual->type=%d", cmap->visual->type);      g_assert_not_reached ();      return FALSE;    }}/* Mimics XFreeColors. */static voidfree_colors (GdkColormap *cmap,	     gulong  	 *pixels,	     gint    	  npixels,	     gulong  	  planes){  PALETTEENTRY pe;  GdkColormapPrivateWin32 *cmapp = GDK_WIN32_COLORMAP_DATA (cmap);  gint i;#ifdef G_ENABLE_DEBUG  gint set_black_count = 0;#endif  gboolean *cleared_entries;  cleared_entries = g_new0 (gboolean, cmap->size);  /* We don't have to do anything for non-palette devices. */    switch (cmap->visual->type)    {    case GDK_VISUAL_GRAYSCALE:    case GDK_VISUAL_PSEUDO_COLOR:      for (i = 0; i < npixels; i++)	{	  if (pixels[i] >= cmap->size)	    ; /* Nothing */	  else if (cmapp->use[pixels[i]] == GDK_WIN32_PE_STATIC)	    ; /* Nothing either*/	  else	    {	      cmapp->use[pixels[i]] = GDK_WIN32_PE_AVAILABLE;	      cleared_entries[pixels[i]] = TRUE;	    }	}      for (i = cmapp->current_size - 1; i >= 0; i--)	if (cmapp->use[i] != GDK_WIN32_PE_AVAILABLE)	  break;      if (i < cmapp->current_size - 1)	{	  GDK_NOTE (COLORMAP, g_print ("free_colors: hpal=%p resize=%d\n",				       cmapp->hpal, i + 1));	  if (!ResizePalette (cmapp->hpal, i + 1))	    WIN32_GDI_FAILED ("ResizePalette");	  else	    cmapp->current_size = i + 1;	}      pe.peRed = pe.peGreen = pe.peBlue = pe.peFlags = 0;      for (i = 0; i < cmapp->current_size; i++)	{	  if (cleared_entries[i])	    {	      if (!SetPaletteEntries (cmapp->hpal, i, 1, &pe))		WIN32_GDI_FAILED ("SetPaletteEntries");	      GDK_NOTE (COLORMAP, set_black_count++);	    }	}#if 0      GDK_NOTE (COLORMAP, _gdk_win32_print_hpalette (cmapp->hpal));#else      GDK_NOTE (COLORMAP, (set_black_count > 0 ?			   g_print ("free_colors: %d (%d) set to black\n",				    set_black_count, cmapp->current_size)			   : (void) 0));#endif      g_free (cleared_entries);      break;    default:      g_assert_not_reached ();    }}/* Mimics XCreateColormap. */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区av| 成人免费视频播放| 成人激情免费网站| 欧美人伦禁忌dvd放荡欲情| 国产蜜臀av在线一区二区三区| 香蕉成人啪国产精品视频综合网 | 国产精品456露脸| 欧美日韩在线精品一区二区三区激情 | 粉嫩av一区二区三区在线播放 | 在线国产亚洲欧美| 久久亚洲二区三区| 视频在线观看91| 色哟哟一区二区三区| 久久精品免视看| 另类综合日韩欧美亚洲| 欧美色成人综合| 亚洲美腿欧美偷拍| 99精品视频一区二区三区| 日本一区二区久久| 国产黑丝在线一区二区三区| 精品sm在线观看| 久草在线在线精品观看| 欧美一级精品在线| 美女网站视频久久| 日韩一区二区三区四区 | 91麻豆精品国产自产在线观看一区 | 国产一区二区在线影院| 日韩精品综合一本久道在线视频| 亚洲www啪成人一区二区麻豆 | 亚洲一区二区高清| 色8久久精品久久久久久蜜| 日韩美女精品在线| 色综合视频一区二区三区高清| 中文字幕亚洲综合久久菠萝蜜| 成人精品国产福利| 日韩美女啊v在线免费观看| 波多野结衣精品在线| 国产精品久久久久久久久免费丝袜| 国产激情一区二区三区| 久久久www成人免费毛片麻豆| 国产老妇另类xxxxx| 国产精品久久久久久久久动漫| 国产成人精品亚洲午夜麻豆| 国产精品国产馆在线真实露脸| 91网页版在线| 亚洲电影第三页| 日韩精品一区二区三区中文不卡 | 亚洲国产一区在线观看| 欧美另类videos死尸| 日韩高清在线电影| 精品国产乱码久久| 国产99久久久精品| 亚洲天堂久久久久久久| 欧美日韩成人激情| 国产久卡久卡久卡久卡视频精品| 中文字幕二三区不卡| 91麻豆国产自产在线观看| 亚洲成a人片综合在线| 精品日韩成人av| 99久久综合色| 偷窥少妇高潮呻吟av久久免费| 精品国产乱码久久久久久浪潮| 成人h动漫精品一区二区| 亚洲乱码国产乱码精品精98午夜| 在线观看91av| 成人国产精品视频| 日韩国产精品大片| 中文字幕在线播放不卡一区| 欧美美女黄视频| 国产91丝袜在线18| 日韩主播视频在线| 国产精品私人自拍| 日韩午夜在线影院| 色999日韩国产欧美一区二区| 美女网站视频久久| 伊人婷婷欧美激情| 久久久www成人免费无遮挡大片| 欧美吻胸吃奶大尺度电影| 精品一区二区三区视频| 亚洲午夜三级在线| 亚洲国产精华液网站w| 欧美精品乱码久久久久久按摩 | 看国产成人h片视频| **网站欧美大片在线观看| 欧美一区二区在线视频| 日本伦理一区二区| 国产精华液一区二区三区| 热久久国产精品| 亚洲网友自拍偷拍| 亚洲欧洲成人精品av97| 国产亚洲精品超碰| 日韩精品一区二区三区三区免费 | 久久精品夜夜夜夜久久| 911精品产国品一二三产区| 成人免费毛片app| 国产乱对白刺激视频不卡| 狂野欧美性猛交blacked| 日韩专区一卡二卡| 亚洲国产综合人成综合网站| 亚洲欧美另类图片小说| 亚洲国产成人午夜在线一区| 亚洲精品一区二区三区在线观看| 欧美一区二区在线免费观看| 欧美三级电影在线看| 色伊人久久综合中文字幕| 91麻豆自制传媒国产之光| 99精品一区二区三区| 波多野结衣中文一区| 成人性视频网站| 懂色av一区二区夜夜嗨| 国产精品99精品久久免费| 国产另类ts人妖一区二区| 国产精品一级在线| 成人午夜激情在线| 成人国产精品免费| 色偷偷一区二区三区| 日本久久电影网| 欧美三级日本三级少妇99| 欧美肥妇毛茸茸| 精品国产乱码久久久久久影片| 精品av久久707| 国产欧美日本一区视频| 国产精品久久免费看| 亚洲日本一区二区三区| 亚洲一区在线观看免费| 天堂成人国产精品一区| 蜜桃精品视频在线观看| 韩国成人福利片在线播放| 国产精品中文欧美| av电影在线观看一区| 在线观看免费一区| 91精品一区二区三区久久久久久| 日韩你懂的在线播放| 中文字幕欧美日本乱码一线二线| 亚洲欧洲成人精品av97| 婷婷久久综合九色综合绿巨人| 奇米四色…亚洲| 成人免费高清视频在线观看| 欧美午夜影院一区| 久久一留热品黄| 亚洲免费视频中文字幕| 婷婷一区二区三区| 国产一区二区不卡在线 | 91精品国产乱码| 欧美mv日韩mv国产| 中文字幕一区二区5566日韩| 偷窥国产亚洲免费视频| 国产精品亚洲第一区在线暖暖韩国 | 亚洲国产视频a| 蜜桃av一区二区| www.在线欧美| 在线播放91灌醉迷j高跟美女| 久久久精品天堂| 夜夜亚洲天天久久| 国内精品免费**视频| 色爱区综合激月婷婷| 久久亚洲精品小早川怜子| 一区二区三区四区视频精品免费| 捆绑调教一区二区三区| 欧日韩精品视频| 久久综合中文字幕| 亚洲电影一区二区| 99视频一区二区三区| 欧美mv和日韩mv国产网站| 亚洲一区二区三区激情| 国产 日韩 欧美大片| 欧美一区二区三区思思人| 亚洲四区在线观看| 国产精品一区在线观看你懂的| 欧美在线不卡一区| 国产精品美女久久久久久久久久久 | 欧美三级电影网| 中文字幕一区在线观看视频| 激情欧美日韩一区二区| 欧美视频在线播放| 亚洲日本电影在线| www.色综合.com| 久久精品视频在线免费观看| 肉肉av福利一精品导航| 在线欧美一区二区| 国产精品电影一区二区三区| 国产一区二区三区免费观看| 欧美精品在欧美一区二区少妇| 亚洲老妇xxxxxx| 91在线精品一区二区| 国产精品午夜电影| 国产.欧美.日韩| 国产欧美一区二区三区在线看蜜臀| 久久不见久久见免费视频7| 精品视频123区在线观看| 亚洲综合视频在线观看| 色哟哟在线观看一区二区三区| 亚洲图片欧美激情| 91在线视频免费91| 综合久久国产九一剧情麻豆| jizzjizzjizz欧美| 成人欧美一区二区三区白人| av在线一区二区| 亚洲免费电影在线| 在线欧美一区二区|