📄 build_windows.c
字号:
/* * Copyright (C) 2000-2004 Damien Douxchamps <ddouxchamps@users.sf.net> * * 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. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#include "coriander.h"extern const char *help_key_bindings_keys[KEY_BINDINGS_NUM];extern const char *help_key_bindings_functions[KEY_BINDINGS_NUM];voidBuildPreferencesWindow(void){ BuildPrefsGeneralFrame(); BuildPrefsDisplayFrame(); BuildPrefsReceiveFrame(); BuildPrefsSaveFrame(); BuildPrefsFtpFrame(); BuildPrefsV4lFrame();}voidBuildFormat7Window(void){ int f; GtkWidget* notebook2; GtkWidget* vbox; GtkWidget* hbox; GtkWidget* table; GtkWidget* frame; GtkWidget* label; GtkWidget* bar; GtkWidget* scale; // this window is built only if the camera supports F7. If there is a support, // the default edit mode is either the currently selected mode (F7 active) or // the first available mode (F7 inactive) // if we are using F7, choose current F7 mode as default if (camera->misc_info.format==FORMAT_SCALABLE_IMAGE_SIZE) { camera->format7_info.edit_mode=camera->misc_info.mode; } // if we are NOT using F7, check if an F7 mode is supported and use the first one as default else { // get first supported F7 mode for (f=MODE_FORMAT7_MIN;f<=MODE_FORMAT7_MAX;f++) { if (camera->format7_info.mode[f-MODE_FORMAT7_MIN].present>0) { f++; break; } } f--; if (camera->format7_info.mode[f-MODE_FORMAT7_MIN].present==0) { // F7 not supported. don't build anything camera->format7_info.edit_mode=-1; } else { camera->format7_info.edit_mode=f; } } notebook2=lookup_widget(main_window,"notebook2"); // if the page exists, remove it: if (format7_tab_presence==1) { gtk_notebook_remove_page(GTK_NOTEBOOK(notebook2),3); format7_tab_presence=0; } if (camera->format7_info.edit_mode>=0) { label = gtk_label_new (_("Format 7")); gtk_widget_ref (label); gtk_object_set_data_full (GTK_OBJECT (main_window), "label_format7_page", label, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label); // big vbox for the whole tab vbox = gtk_vbox_new (FALSE, 0); gtk_widget_ref (vbox); gtk_object_set_data_full (GTK_OBJECT (main_window), "vbox34", vbox, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (vbox); // the format7 tab should be placed in position 3 here: gtk_notebook_insert_page(GTK_NOTEBOOK (notebook2), GTK_WIDGET(vbox),label, 3); // mode frame frame = gtk_frame_new (_("Current mode")); gtk_widget_ref (frame); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_mode_frame", frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); table = gtk_table_new (1, 3, FALSE); gtk_widget_ref (table); gtk_object_set_data_full (GTK_OBJECT (main_window), "table19", table, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (table); gtk_container_add (GTK_CONTAINER (frame), table); label = gtk_label_new (_("Coding:")); gtk_widget_ref (label); gtk_object_set_data_full (GTK_OBJECT (main_window), "label13", label, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_misc_set_padding (GTK_MISC (label), 6, 0); // bytes_per_packet tab frame = gtk_frame_new (_("Packet size")); gtk_widget_ref (frame); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_packet_frame", frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); hbox = gtk_hbox_new (FALSE, 0); gtk_widget_ref (hbox); gtk_object_set_data_full (GTK_OBJECT (main_window), "hbox57", hbox, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (hbox); gtk_container_add (GTK_CONTAINER (frame), hbox); scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 0, 0, 0))); gtk_widget_ref (scale); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_packet_size", scale, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (scale); gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0); gtk_scale_set_digits (GTK_SCALE (scale), 0); // horizontal setup frame = gtk_frame_new (_("Horizontal setup")); gtk_widget_ref (frame); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_horizontal_frame", frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); table = gtk_table_new (2, 2, FALSE); gtk_widget_ref (table); gtk_object_set_data_full (GTK_OBJECT (main_window), "table70", table, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (table); gtk_container_add (GTK_CONTAINER (frame), table); label = gtk_label_new (_("Size")); gtk_widget_ref (label); gtk_object_set_data_full (GTK_OBJECT (main_window), "label139", label, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_misc_set_padding (GTK_MISC (label), 2, 2); label = gtk_label_new (_("Position")); gtk_widget_ref (label); gtk_object_set_data_full (GTK_OBJECT (main_window), "label140", label, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_misc_set_padding (GTK_MISC (label), 2, 2); scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 255, 10, 0, 0))); gtk_widget_ref (scale); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_hsize_scale", scale, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (scale); gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_scale_set_digits (GTK_SCALE (scale), 0); scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 255, 10, 0, 0))); gtk_widget_ref (scale); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_hposition_scale", scale, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (scale); gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_scale_set_digits (GTK_SCALE (scale), 0); // vertical setup frame = gtk_frame_new (_("Vertical setup")); gtk_widget_ref (frame); gtk_object_set_data_full (GTK_OBJECT (main_window), "format7_vertical_frame", frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); table = gtk_table_new (2, 2, FALSE); gtk_widget_ref (table); gtk_object_set_data_full (GTK_OBJECT (main_window), "table71", table, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (table); gtk_container_add (GTK_CONTAINER (frame), table); label = gtk_label_new (_("Size"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -