26 #define VERSION 0x0003
27 #define DEF_LOCKED_COLOR "red"
28 #define DEF_MENUKEY "Control+Alt+V"
29 #define DEF_PREV_ITEM_KEY "Control+Alt+C"
30 #define DEF_EXEC_ITEM_KEY "Control+Alt+E"
31 #define DEF_CLIPBOARD_STR "PRIMARY"
32 #define DEF_CLIPBOARD GDK_SELECTION_PRIMARY
33 #define MAX_ITEM_LENGTH 40
36 /* ==========================================================================
49 /* number of items to keep (may be overriden from command line) */
50 extern gint num_items_to_keep
;
52 /* when true, clipboard will be automatically taken up by wmcliphist */
53 extern gint auto_take_up
;
55 /* number of items kept */
56 extern gint num_items
;
58 /* list of clipboard history items */
59 extern GList
*history_items
;
62 extern HISTORY_ITEM
*selected
;
64 /* current number of locked items */
65 extern gint locked_count
;
68 /* which clipboard to use */
69 extern gchar clipboard_str
[32];
70 extern GdkAtom clipboard
;
73 #define dump_history_list(header) dump_history_list_fn(header)
75 #define dump_history_list(header)
80 * get clipboard content - partialy inspired by Downloader for X
83 my_get_xselection(GtkWidget
*window
, GdkEvent
*event
);
86 * clipboard conversion - inspired by Downloader for X too :)
92 * handles request for selection from other apps
95 selection_handle(GtkWidget
*widget
,
96 GtkSelectionData
*selection_data
,
102 /* ==========================================================================
115 GtkWidget
*menu_item
;
120 extern GList
*action_list
;
124 * returns config/data file name in user's home
127 rcconfig_get_name(char *append
);
130 * read and parse rcconfig
133 rcconfig_get(char *fname
);
143 /* ==========================================================================
149 #define E_OPEN (E_BASE | 1)
150 #define E_INVALID (E_BASE | 2)
151 #define E_REMOVE (E_BASE | 3)
152 #define E_TOO_MUCH (E_BASE | 4)
153 #define E_WRITE (E_BASE | 5)
154 #define E_RENAME (E_BASE | 6)
158 * process new history item
161 process_item(char *content
, gint locked
, gboolean exec
);
165 /* ==========================================================================
172 extern int autosave_period
;
177 extern int confirm_exec
;
180 * Exec immediately when item is captured?
182 extern int exec_immediately
;
185 * move supplied item to begin
188 move_item_to_begin(HISTORY_ITEM
*item
);
194 exec_item(char *content
, ACTION
*action
);
197 * loads history from file
200 history_load(gboolean dump_only
);
203 * store history to file
215 * autosave timer function
221 /* ==========================================================================
226 extern gchar menukey_str
[32];
227 extern guint menukey
;
228 extern gchar prev_item_key_str
[32];
229 extern gchar exec_item_key_str
[32];
234 extern int exec_hotkey
;
250 /* ==========================================================================
254 /* color of locked item */
255 extern gchar locked_color_str
[32];
256 extern GdkRGBA locked_color
;
257 extern gint submenu_count
;
260 * Exec on middle click?
262 extern int exec_middleclick
;
264 /* main window widget */
265 extern GtkWidget
*main_window
;
267 /* dock icon widget */
268 extern GtkWidget
*dock_app
;
270 /* clipboard history menu */
271 extern GtkWidget
*menu_hist
;
272 extern GtkWidget
*menu_title
;
274 /* application menu */
275 extern GtkWidget
*menu_app
;
276 extern GtkWidget
*menu_app_clip_ignore
;
277 extern GtkWidget
*menu_app_clip_lock
;
278 extern GtkWidget
*menu_app_exit
;
279 extern GtkWidget
*menu_app_save
;
282 extern GtkWidget
*button
;
285 extern GtkWidget
*event
;
288 extern GtkWidget
*pixmap
;
291 * dock button click response
294 button_press(GtkWidget
*widget
, GdkEvent
*event
, gpointer data
);
297 * checks, if there is already such item in menu,
298 * in which case it moves it to the begining
301 menu_item_exists(gchar
*content
, GtkWidget
*submenu
);
304 * add new item to menu
307 menu_item_add(gchar
*content
, gint locked
, GtkWidget
*target_menu
);
311 * application main menu handler
314 menu_app_item_click(GtkWidget
*menuitem
, gpointer data
);
318 * open dialog with specified message andbuttons
319 * and return number of button pressed
322 show_message(gchar
*message
, char *title
,
323 char *b1_text
, char *b2_text
, char *b3_text
);
327 /* ==========================================================================
331 from_utf8(gchar
*string
);