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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜av区久久| 欧美一区二区三区婷婷月色| 5858s免费视频成人| 久久久久久久免费视频了| 一区二区三区四区不卡视频| 国产美女一区二区| 日韩欧美一区二区免费| 亚洲日本青草视频在线怡红院| 老司机免费视频一区二区| 色婷婷av一区| 中文在线资源观看网站视频免费不卡| 肉色丝袜一区二区| 欧美性猛片aaaaaaa做受| 国产情人综合久久777777| 免费观看在线综合| 欧美三级日韩三级国产三级| 亚洲精品乱码久久久久久久久| 韩日欧美一区二区三区| 91麻豆精品国产91久久久久久久久 | 国产精品国产自产拍高清av| 免费精品99久久国产综合精品| 欧美专区日韩专区| 亚洲精品成人a在线观看| 99久久免费精品| 一区二区中文字幕在线| bt欧美亚洲午夜电影天堂| 国产日韩欧美电影| 国产成人亚洲精品青草天美| 2017欧美狠狠色| 久久精品噜噜噜成人88aⅴ| 4438亚洲最大| 麻豆视频一区二区| 欧美成人性战久久| 精品综合免费视频观看| 久久尤物电影视频在线观看| 国产酒店精品激情| 久久精品视频一区二区三区| 国产裸体歌舞团一区二区| 久久综合久久99| 国产精品1区二区.| 国产精品天干天干在线综合| 成人一道本在线| 亚洲精品乱码久久久久| 在线观看av不卡| 日精品一区二区三区| 日韩美一区二区三区| 黑人精品欧美一区二区蜜桃 | 亚洲一区二区在线观看视频 | 91国偷自产一区二区三区成为亚洲经典 | 国产欧美1区2区3区| 国产jizzjizz一区二区| 国产嫩草影院久久久久| 91免费看`日韩一区二区| 亚洲国产精品久久人人爱| 欧美一区二区免费观在线| 激情综合色综合久久| 国产精品卡一卡二卡三| 在线观看一区二区视频| 久久不见久久见免费视频1| 国产精品网站一区| 欧美三级视频在线播放| 精品一区二区三区免费观看| 国产精品美女视频| 欧美伦理视频网站| 国产九色精品成人porny| 亚洲欧美视频在线观看| 日韩欧美一区中文| 不卡视频免费播放| 日韩电影免费在线看| 国产日韩欧美精品一区| 911精品国产一区二区在线| 国产精品亚洲一区二区三区妖精| 一区二区三区在线免费| 精品动漫一区二区三区在线观看| av网站免费线看精品| 日本在线不卡视频| 亚洲欧美国产77777| 精品噜噜噜噜久久久久久久久试看 | 亚洲最大的成人av| 久久久久久免费| 欧美日韩国产首页| 波波电影院一区二区三区| 麻豆成人av在线| 亚洲成人av一区二区| 亚洲国产精品精华液2区45| 日韩一区二区三区精品视频| 色伊人久久综合中文字幕| 国产麻豆精品95视频| 午夜国产精品一区| 亚洲精品成人精品456| 中文字幕免费一区| 精品久久久久久亚洲综合网| 欧美精品v国产精品v日韩精品| a美女胸又www黄视频久久| 国精品**一区二区三区在线蜜桃| 亚洲高清视频在线| 亚洲无线码一区二区三区| 国产精品夫妻自拍| 日本一区二区三区视频视频| 欧美大黄免费观看| 日韩一区二区在线播放| 欧美日韩久久一区二区| 91国模大尺度私拍在线视频| 91小宝寻花一区二区三区| 成人h版在线观看| 国产乱子伦视频一区二区三区| 奇米在线7777在线精品| 性感美女极品91精品| 亚洲成人免费电影| 亚洲成人av一区二区三区| 亚洲成人免费观看| 午夜视频一区二区三区| 天天射综合影视| 日韩精品免费视频人成| 五月婷婷久久综合| 午夜精品久久久久久久 | 成人理论电影网| 成人黄色小视频在线观看| 国产成人av一区| 成人听书哪个软件好| 99久久久精品| 色婷婷综合激情| 在线一区二区三区| 欧美日韩黄色影视| 欧美成人女星排行榜| 精品成a人在线观看| 久久色.com| 国产精品不卡在线| 亚洲国产欧美在线| 蜜臀久久99精品久久久画质超高清 | 日本一区二区免费在线| 亚洲欧洲三级电影| 亚洲一区二区美女| 久久99精品视频| 国产精品一区专区| 97久久精品人人爽人人爽蜜臀| av午夜一区麻豆| 欧美精品丝袜久久久中文字幕| 日韩一区二区三区三四区视频在线观看| 日韩精品在线一区| 国产精品乱码久久久久久| 亚洲精品国久久99热| 美脚の诱脚舐め脚责91| 不卡视频免费播放| 91麻豆精品国产91久久久更新时间| 日韩免费看的电影| 亚洲色大成网站www久久九九| 日韩国产一二三区| 成人一级视频在线观看| 欧美日韩高清一区二区不卡| 久久伊人中文字幕| 亚洲伦在线观看| 韩国女主播成人在线观看| 91小视频在线观看| 精品国产制服丝袜高跟| 亚洲欧美日韩国产另类专区| 久久99精品国产麻豆婷婷洗澡| 91网站最新网址| 欧美大片在线观看| 亚洲天堂免费在线观看视频| 美国三级日本三级久久99| 91美女片黄在线| 国产亚洲短视频| 日韩高清欧美激情| www.在线成人| 久久夜色精品国产欧美乱极品| 亚洲综合色婷婷| 东方aⅴ免费观看久久av| 91精品国产综合久久久蜜臀粉嫩 | 久久一区二区三区四区| 亚洲成人免费看| 色噜噜狠狠成人中文综合| 欧美精品一区二区三区很污很色的| 一区二区三区美女| 成人av在线一区二区| 久久综合九色综合欧美亚洲| 日韩 欧美一区二区三区| 色综合久久久网| 中文字幕一区二区在线观看| 国产精品小仙女| 欧美电影免费观看高清完整版在| 天天综合天天做天天综合| 色av综合在线| 亚洲欧美日韩国产中文在线| 99久久久久免费精品国产 | 欧美成人精精品一区二区频| 亚洲一区二区影院| 日本黄色一区二区| 亚洲色图欧美偷拍| 色综合久久久久| 中文字幕一区二区日韩精品绯色| 国产成人精品aa毛片| 国产欧美一区二区精品久导航 | 日韩中文字幕一区二区三区| 欧美丝袜丝交足nylons| 亚洲伊人色欲综合网| 91高清视频在线| 亚洲成人一二三| 欧美日韩久久一区| 美女高潮久久久|