📄 commonheader.h
字号:
/* * Compaq Hot Plug Controller Graphical User Interface * Copyright 2000, 2001 Compaq Computer Corporation * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Please send all questions or concerns to linuxhotplug@compaq.com */#ifdef MAIN_SOURCE_FILE#define EXTERNAL#else#define EXTERNAL extern#endif#ifndef _COMMONHEADER_H#define _COMMONHEADER_H#include <gnome.h>#include <gtk/gtk.h>#include <gdk/gdk.h>#include <dirent.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/fcntl.h>#include <sys/stat.h>#include <sys/types.h>#include <unistd.h>#include <semaphore.h>#include <signal.h> typedef unsigned char u8;typedef unsigned short u16;typedef unsigned int u32;#include "cpqphpd_ioctl.h"#include "tree.h"#define GUI_BACK_DOOR 28#define MAXLEN 128#define MAXTABLEROW 50#define MAXSLOTS 15#define MAXTYPES 4#define NOT_SELECTED -1#define ADD_ADAPTER 1#define REMOVE_ADAPTER 2#define INSERT_DRIVER 3#define REMOVE_DRIVER 4#define ENABLE_ATT_STATUS 5#define DISABLE_ATT_STATUS 6#define CPQPHPD_PROC_ROOT "/proc/cpqphpd"/******************************************************** * GLOBAL VARIABLES ********************************************************/extern GtkCTree* g_tree; // global treeextern GtkWidget* g_window; // global windowextern GtkWidget* g_statusbar; // global status barextern GtkWidget* g_table; // global tableextern GtkWidget* g_add_adapter_button; // global add adapter buttonextern GtkWidget* g_add_adapter_menu_item; // global add adapter menu itemextern GtkWidget* g_remove_adapter_button; // global remove adapterr buttonextern GtkWidget* g_remove_adapter_menu_item; // global remove adapter menu itemextern GtkWidget* g_insert_driver_button; // global insert driver buttonextern GtkWidget* g_insert_driver_menu_item; // global insert driver menu itemextern GtkWidget* g_remove_driver_button; // global remove driver buttonextern GtkWidget* g_remove_driver_menu_item; // global remove driver menu itemextern GtkWidget* g_enable_att_status_button; // global enable attention status buttonextern GtkWidget* g_enable_att_status_menu_item; // global enable attention status menu itemextern GtkWidget* g_disable_att_status_button; // global disable attention status buttonextern GtkWidget* g_disable_att_status_menu_item; // global disable attention status menu itemextern GtkCTreeNode* g_node; // global tree nodeextern gint context_id; // global context id used for statusbar messagesextern gint selected_row; // global (tree) row variableextern pci_tree_node* g_pci_node; // global pci tree nodeextern int g_table_size; // global table sizeextern char g_table_array[MAXTABLEROW*MAXLEN]; // global structure for table dataextern GtkStyle* g_style_array[MAXTABLEROW][2]; // global structure for table stylesextern int bus_based[MAXTYPES]; // priority array - bus dominatedextern int slot_based[MAXTYPES]; // priority array - slot dominatedextern int adapter_based[MAXTYPES]; // priority array - adapter dominatedextern int function_based[MAXTYPES]; // priority array - function dominated// global pixmap variablesextern GdkPixmap *card_icon, *att_status_on_icon, *att_status_off_icon; extern GdkPixmap *small_card_insert_icon, *small_card_remove_icon;extern GdkPixmap *small_enable_att_status_icon, *small_disable_att_status_icon;extern GdkPixmap *card_insert_icon, *card_remove_icon;extern GdkPixmap *enable_att_status_icon, *disable_att_status_icon;// global bitmap variablesextern GdkBitmap *card_icon_mask, *att_status_on_icon_mask, *att_status_off_icon_mask; extern GdkBitmap *small_card_insert_icon_mask, *small_card_remove_icon_mask;extern GdkBitmap *small_enable_att_status_icon_mask, *small_disable_att_status_icon_mask;extern GdkBitmap *card_insert_icon_mask, *card_remove_icon_mask;extern GdkBitmap *enable_att_status_icon_mask, *disable_att_status_icon_mask;// color variablesextern GdkColor red ;extern GdkColor blue ;extern GdkColor green ;extern GdkColor yellow ;extern GdkColor purple ;extern GdkColor orange ;extern GdkColor cyan ;extern GdkColor black ;extern GdkColor white ;extern GdkColor gray ;extern GdkColor light_gray ;extern sem_t critical; // semaphore variableextern int dev_hpc; // device node variableextern ioctl_data stuff; // structure needed for ioctl callsextern struct sigaction sact, osact; // signal handler variables#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -